diff --git a/geoconvert/data/countries.py b/geoconvert/data/countries.py index 293a26a..52796cb 100644 --- a/geoconvert/data/countries.py +++ b/geoconvert/data/countries.py @@ -17,14 +17,21 @@ "republik kongo": "CG", # de "republica do congo": "CG", # pt "congo": "CG", # en, fr - # Make sure we never mistake it for SD + # Make sure we never mistake it for GN (Guinea) + "aquatorialguinea": "GQ", # es + "equatorial guinea": "GQ", # de / en + "guinea bissau": "GW", # en / de + "guinea ecuatorial": "GQ", # es + "pap new guinea": "PG", # en + "papua neuguinea": "PG", # de + "papua new guinea": "PG", # en + "papua nueva guinea": "PG", # es + # Make sure we never mistake it for JE (Jersey) + "new jersey": "US", + # Make sure we never mistake it for SD (Sudan) "south sudan": "SS", # en "sudsudan": "SS", # de "sudan del sur": "SS", # es - # Make sure we never mistake it for JE - "new jersey": "US", - # Make sure we never mistake it for GN - "papua new guinea": "PG" } @@ -126,7 +133,6 @@ "guinee": "GN", "guinee bissau": "GW", "guinee equatoriale": "GQ", - "guinee bissau": "GW", "guyana": "GY", "guyane francaise": "GF", "haiti": "HT", @@ -366,7 +372,6 @@ "ecuador": "EC", "egypt": "EG", "el salvador": "SV", - "equatorial guinea": "GQ", "eritrea": "ER", "estonia": "EE", "eswatini": "SZ", @@ -393,7 +398,6 @@ "guatemala": "GT", "guernsey": "GG", "guinea": "GN", - "guinea bissau": "GW", "guyana": "GY", "haiti": "HT", "heard island": "HM", @@ -482,8 +486,6 @@ "palestinian territories": "PS", "west bank": "PS", "panama": "PA", - "pap new guinea": "PG", - "papua new guinea": "PG", "paraguay": "PY", "peru": "PE", "philippines": "PH", @@ -579,7 +581,6 @@ **special_countries, **{ "agypten": "EG", - "aquatorialguinea": "GQ", "athiopien": "ET", "afghanistan": "AF", "albanien": "AL", @@ -631,7 +632,6 @@ "griechenland": "GR", "guatemala": "GT", "guinea": "GN", - "guinea bissau": "GW", "guyana": "GY", "haiti": "HT", "honduras": "HN", @@ -707,7 +707,6 @@ "palastina": "PS", "palau": "PW", "panama": "PA", - "papua neuguinea": "PG", "paraguay": "PY", "peru": "PE", "philippinen": "PH", @@ -1133,9 +1132,7 @@ "guernsey": "GG", "guayana": "GY", "guayana francesa": "GF", - "guinea bissau": "GW", "guinea": "GN", - "guinea ecuatorial": "GQ", "haiti": "HT", "islas heard y mcdonald": "HM", "heard y mcdonald": "HM", @@ -1211,7 +1208,6 @@ "palaos": "PW", "palestina": "PS", "panama": "PA", - "papua nueva guinea": "PG", "pakistan": "PK", "paraguay": "PY", "peru": "PE", diff --git a/test_geoconvert.py b/test_geoconvert.py index 29a7207..c63b059 100644 --- a/test_geoconvert.py +++ b/test_geoconvert.py @@ -479,10 +479,34 @@ def test_fr_region_name_to_info(self, input_data, expected): # If no country found, return None ("Wonderland", {}, None), ("Germany", {"lang": "fr"}, None), - # No confusion with Congo + # No confusion with Congo ("CD") ("Congo (Brazzaville)", {}, "CG"), ("Congo (Kinshasa)", {}, "CD"), ("Congo", {}, "CG"), + # No confusion with Guinea ("GN") + # "GQ" + ("equatorial guinea", {}, "GQ"), # de / en + ("aquatorialguinea", {}, "GQ"), # es + ("guinee equatoriale", {}, "GQ"), #fr + ("guine equatorial", {}, "GQ"), # pt + # "PG" + ("papua neuguinea", {}, "PG"), # de + ("pap new guinea", {}, "PG"), # en + ("papua nueva guinea", {}, "PG"), # es + ("papouasie nouvelle guinee", {}, "PG"), # fr + ("papua nova guine", {}, "PG"), # pt + # "GW" + ("guinea bissau", {}, "GW"), # de / en / es + ("guinee bissau", {}, "GW"), # fr + ("guine bissau", {}, "GW"), # pt + # No confusion with Jersey ("JE") + ("new jersey", {}, "US"), + # No confusion with Sudan ("SD") + ("sudsudan", {}, "SS"), # de + ("south sudan", {}, "SS"), # en + ("sudan del sur", {}, "SS"), # es + ("Soudan du Sud", {}, "SS"), # fr + ("sudao do sul", {}, "SS"), # pt # Any capitalization for lang works ("Germany", {"lang": "en"}, "DE"), ("Germany", {"lang": "En"}, "DE"), @@ -531,6 +555,7 @@ def test_country_name_to_country_code(self, input_data, kwargs, expected): ("Congo (Brazzaville)", "CG"), ("Congo (Kinshasa)", "CD"), ("São tome & principe ", "ST"), + ("Papouasie Nouvelle Guinée", "PG"), ], ) def test_country_name_to_country_code_fr(self, input_data, expected): @@ -623,6 +648,7 @@ def test_country_name_to_country_code_de(self, input_data, expected): ("o país do peru", "PE"), (u"País de execução: Polónia", "PL"), ("São Vicente e Granadinas ", "VC"), + ("Guine bissau", "GW"), ], ) def test_country_name_to_country_code_pt(self, input_data, expected):