diff options
author | tatiana-yan <tatiana.kondakova@gmail.com> | 2019-05-23 19:21:30 +0300 |
---|---|---|
committer | mpimenov <mpimenov@users.noreply.github.com> | 2019-05-23 19:33:14 +0300 |
commit | b075f5f771d2af5efff97296e1ad9b0f250b60a1 (patch) | |
tree | 34aeda7f7c315a98cefb2c3a68e780c60dd81c63 /generator | |
parent | a785af047b650118a8f01c9edf83aa9dd2c61da6 (diff) |
[search] Fix search synonyms for China
Diffstat (limited to 'generator')
-rw-r--r-- | generator/search_index_builder.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
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])); } } |