forked from organicmaps/organicmaps
[search] Add country name synonyms to downloaderSearchCallback.
This commit is contained in:
parent
f7f16ef9df
commit
cb487d007a
1 changed files with 8 additions and 0 deletions
|
@ -20,6 +20,7 @@ namespace
|
|||
bool GetGroupCountryIdFromFeature(storage::Storage const & storage, FeatureType & ft,
|
||||
std::string & name)
|
||||
{
|
||||
auto const & synonyms = storage.GetCountryNameSynonyms();
|
||||
int8_t const langIndices[] = {StringUtf8Multilang::kEnglishCode,
|
||||
StringUtf8Multilang::kDefaultCode,
|
||||
StringUtf8Multilang::kInternationalCode};
|
||||
|
@ -30,6 +31,13 @@ bool GetGroupCountryIdFromFeature(storage::Storage const & storage, FeatureType
|
|||
continue;
|
||||
if (storage.IsInnerNode(name))
|
||||
return true;
|
||||
auto const it = synonyms.find(name);
|
||||
if (it == synonyms.end())
|
||||
continue;
|
||||
if (!storage.IsInnerNode(it->second))
|
||||
continue;
|
||||
name = it->second;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue