Translations endpoint and strictMatch parameter: Unexpected behaviour

bendeckobendecko Member
edited May 13 in API endpoints

/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

Sign In or Register to comment.