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

Synonyms are not always shown in the results list #37

Open timpaul opened 6 years ago

timpaul commented 6 years ago

In the example below you can see that when typing 'un', 'Burma' is returned as a result, but with no alias given, which makes it hard to understand why it's in the list (same goes for 'Egypt').

image

If you look in the data you’ll see:

  1. A country code, MM, which is named ‘Burma’
  2. A synonym for MM, which is named ‘Union of Burma’

So it appears to be matching the ‘Un’ of ‘Union of Burma’, but not outputting the synonym in the list. This may be a design choice rather than a bug, but in this example it's producing a confusing result.

edwardhorsford commented 6 years ago

I think this may be related to it having old data.

The synonyms have a concept of being 'canonical' or 'non-canonical' - are they official or not. A typo would be non-canonical, whilst an official name would. Matches against canonical names get shown in brackets, but not non-canonical ones don't show in brackets - in this case, 'Union of Burma' should probably be marked as canonical. At one point there were many cases like this and I think we were waiting on an updated data file.