Translations endpoint and strictMatch parameter: Unexpected behaviour
Categories
- 321 All Categories
- 3 Language datasets
- 9 News and updates
- 18 API endpoints
- 15 Review my code
- 6 Tutorials and presentations
- 92 Frequently asked questions
- 5 How to get useful technical help
- 2 Member guidelines
- 12 Suggest an improvement
- 58 Report a bug
- 9 Ask the Community: Other
- 54 Ask the Community: Technical and operational questions
- 60 General
Translations endpoint and strictMatch parameter: Unexpected behaviour

/api/v2/translations/{source_lang_translate}/{target_lang_translate}/{word_id}:
Considering the Spanish words 'Si' - "If", and "Sí" - "Yes"
If I send the request:
https://od-api.oxforddictionaries.com/api/v2/translations/es/en/ S% C3 %AD?strictMatch=true
(note I had to space out the urlencode because the forum was encoding it)
https://od-api.oxforddictionaries.com/api/v2/translations/es/en/Sí?strictMatch=true
That is "S%C3%AD" as the urlencoded form of 'Sí' I get:
{
"error": "No entry found matching supplied source_lang target_lang and word"
}
The documentation states "...Specifies whether diacritics must match exactly. If "false", near-homographs for the given word_id will also be selected (e.g., rose matches both rose and rosé; similarly rosé matches both)...."
However if I send:
https://od-api.oxforddictionaries.com/api/v2/translations/es/en/ S% C3 %AD?strictMatch=false
(note I had to space out the urlencode because the forum was encoding it)
https://od-api.oxforddictionaries.com/api/v2/translations/es/en/Sí?strictMatch=false
I get both the "yes" and "if" translations:
"results": [
{
"id": "si",
"language": "es",
and later:
{
"id": "s%C3%AD",
"language": "es",
"lexicalEntries": [
{
"entries": [
{
Seems that strictMatch=true behaviour is incorrect as I would anticipate sending 'Sí' with accent and strictMatch=true to bring back that, and only that, as a result
Comments
Hello @bendecko
When using strict match the API is case sensitive, so you will need to request "sí" in lowcase, otherwise API isnot able to find it.