Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fuzzy search unexpectedly ranks Nigeria over Niger when searching for "Niger" #115

Open
JovanNj opened this issue Jun 3, 2022 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@JovanNj
Copy link

JovanNj commented Jun 3, 2022

Hi,
First of all, thank you for the excellent library, since we a re working a lot on country data we find pycountry very useful.
We stumbled upon one issue: when we try fuzzy search for Niger, it returns results for Niger and Nigeria, with Nigeria as first result. Is it possible to somehow "boost" the result for Niger to the first place?
Also, fuzzy search on "UK" does not return United Kingdom at all.

Best regards,
Jovan Nj

@alanorth
Copy link
Contributor

Another incorrect fuzzy search match with "Saint-Martin":

In [1]: import pycountry

In [2]: pycountry.countries.search_fuzzy("Saint Martin")
Out[2]: [Country(alpha_2='MF', alpha_3='MAF', flag='🇲🇫', name='Saint Martin (French part)', numeric='663')]

In [3]: pycountry.countries.search_fuzzy("Saint-Martin")
Out[3]: [Country(alpha_2='FR', alpha_3='FRA', flag='🇫🇷', name='France', numeric='250', official_name='French Republic')]

The first is correct, the second is not.

@doriand01
Copy link

Confirmed that the search result for search_fuzzy() returns Nigeria as first place.

@ctheune ctheune changed the title Does not recognize country Niger Fuzzy search unexpectedly ranks Nigeria over Niger when searching for "Niger" Aug 25, 2022
@nschimmoller nschimmoller added enhancement New feature or request help wanted Extra attention is needed labels Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants