diff --git a/data/synonyms.txt b/data/synonyms.txt index c660336dd7..7ebb27722d 100644 --- a/data/synonyms.txt +++ b/data/synonyms.txt @@ -69,6 +69,6 @@ Yukon: YT Россия: РФ Китайская Народная Република: Китай, КНР -Китай: Китайская Народная Република, КНР +Китай: КНР People's Republic of China: China, PRC -China: People's Republic of China, PRC +China: PRC diff --git a/generator/search_index_builder.cpp b/generator/search_index_builder.cpp index c81b309453..3cff6fc452 100644 --- a/generator/search_index_builder.cpp +++ b/generator/search_index_builder.cpp @@ -77,8 +77,10 @@ public: for (size_t i = 1; i < tokens.size(); ++i) { strings::Trim(tokens[i]); - // synonym should not has any spaces - ASSERT(tokens[i].find_first_of(" \t") == string::npos, ()); + // For consistency, synonyms should not have any spaces. + // For example, the hypothetical "Russia" -> "Russian Federation" mapping + // would have the feature with name "Russia" match the request "federation". It would be wrong. + CHECK(tokens[i].find_first_of(" \t") == string::npos, ()); m_map.insert(make_pair(tokens[0], tokens[i])); } }