alphagov / govuk-country-and-territory-autocomplete

An autocomplete widget that uses data from Country and Territory Register.
https://alphagov.github.io/govuk-country-and-territory-autocomplete/examples/
MIT License
36 stars 18 forks source link

Côte d'Ivoire not recognized with circumflex #40

Open edwardhorsford opened 6 years ago

edwardhorsford commented 6 years ago

Raised by @Smylers in this issue.

Ivory Coast is also known by its French name of Côte d'Ivoire, but your picker doesn't recognize it, not matching anything after ‘Cô’: Screen shot showing ‘no results found’ after typing ‘Cô’ It does work if you Asciify it as ‘Cote’ rather than ‘Côte’, but if somebody's going to use the French name they may expect it to have the French accent on it.

You could either add ‘Côte d'Ivoire’, and its longer form ‘The Republic of Côte d'Ivoire’, as additional endonyms. Or fix this more generally by ignoring all diacritics when matching.

edwardhorsford commented 6 years ago

Thanks for raising @Smylers!

I thought we dealt with diacritics, but it looks like we didn't get to that (or else there's a bug).

Nominally I think it would be good to match with and without the diacritic - if it matches with it, we score higher. But we should still match without it.