diff options
author | tatiana-yan <tatiana.kondakova@gmail.com> | 2019-05-24 15:25:19 +0300 |
---|---|---|
committer | mpimenov <mpimenov@users.noreply.github.com> | 2019-05-27 17:08:42 +0300 |
commit | f7f16ef9dfc89d7aa5655be4e4f5d07772cc2b90 (patch) | |
tree | 4864aea4c2eb6c423c4aa14f7a5e6213f1048657 /map | |
parent | e08a9d988ea63fd625bdcdaac646bfac41060c43 (diff) |
[data] Add country_synonyms.csv to fill country_name_synonyms fields during generation. Update counties.txt
Diffstat (limited to 'map')
-rw-r--r-- | map/map_tests/countries_names_tests.cpp | 33 |
1 files changed, 7 insertions, 26 deletions
diff --git a/map/map_tests/countries_names_tests.cpp b/map/map_tests/countries_names_tests.cpp index 9c6dc3211b..a5ef3b48ae 100644 --- a/map/map_tests/countries_names_tests.cpp +++ b/map/map_tests/countries_names_tests.cpp @@ -32,6 +32,7 @@ UNIT_TEST(CountriesNamesTest) { Framework f(FrameworkParams(false /* m_enableLocalAds */, false /* m_enableDiffs */)); auto & storage = f.GetStorage(); + auto const & synonyms = storage.GetCountryNameSynonyms(); auto handle = search::FindWorld(f.GetDataSource()); TEST(handle.IsAlive(), ()); @@ -48,32 +49,9 @@ UNIT_TEST(CountriesNamesTest) StringUtf8Multilang::kDefaultCode, StringUtf8Multilang::kInternationalCode}; - // todo: (@t.yan) fix names for countries which have separate mwms. - set<string> const kIgnoreList = {"China", - "American Samoa", - "Sāmoa", - "Pitcairn", - "South Georgia and South Sandwich Islands", - "Lesotho", - "Eswatini", - "Republic of the Congo", - "Democratic Republic of the Congo", - "Aruba", - "Sint Maarten", - "Bahamas", - "Cabo Verde", - "Ivory Coast", - "Palestinian Territories", - "Turkish Republic Of Northern Cyprus", - "Nagorno-Karabakh Republic", - "Vatican City", - "North Macedonia", - "Kosovo", - "Czechia", + set<string> const kIgnoreList = {"Turkish Republic Of Northern Cyprus", "Transnistria", - "Republic of Belarus", - "Hong Kong", - "Guam", + "Nagorno-Karabakh Republic", // MAPSME-10611 "Mayorca Residencial", "Magnolias Residencial"}; @@ -92,7 +70,10 @@ UNIT_TEST(CountriesNamesTest) string name; if (!ft->GetName(langIndex, name)) return false; - return storage.IsNode(name) || kIgnoreList.count(name) != 0; + auto const it = synonyms.find(name); + if (it == synonyms.end()) + return storage.IsNode(name) || kIgnoreList.count(name) != 0; + return storage.IsNode(it->second); }), ("Cannot find countries.txt record for country feature:", ft->DebugString(FeatureType::BEST_GEOMETRY))); |