From 5cd87496d626e6344cdfc21fcf9f4185cf6498c7 Mon Sep 17 00:00:00 2001 From: Maxim Pimenov Date: Wed, 14 Dec 2016 16:39:35 +0300 Subject: [PATCH] [search] More synonyms. --- data/categories.txt | 6 ++--- .../processor_test.cpp | 25 +++++++++++++++++++ 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/data/categories.txt b/data/categories.txt index e939880aac..9655f814e7 100644 --- a/data/categories.txt +++ b/data/categories.txt @@ -2580,7 +2580,7 @@ sk:3Divadlo|zábava sw:Thieta|burudani|maonyesho amenity-nightclub -en:3Nightclub|3disco|dance|entertainment|U+1F378|U+1F379|U+1F46F|U+1F483 +en:3Nightclub|night club|3disco|dance|entertainment|U+1F378|U+1F379|U+1F46F|U+1F483 ru:3Ночной клуб|3дискотека|развлечения ar:نادي ليلي|رقص|التسلية cs:4Noční klub|3disco|3klub|zábava @@ -2598,7 +2598,7 @@ nb:Nattklubb|underholdning pl:3Dyskoteka|klub nocny|rozrywka pt:3Discoteca|3dançar|entretenimento ro:Club de noapte|divertisment -es:3Discoteca|nightclub|entretenimiento +es:3Discoteca|nightclub|night club|entretenimiento sv:3Nattklubb|3disco|dans|underhållning th:3ไนต์คลับ|การเต้นรำ|แหล่งบันเทิง tr:3Gece kulübü|dans|eğlence @@ -2606,7 +2606,7 @@ uk:3Нічний клуб|3дискотека|розваги vi:Câu lạc bộ đêm|giải trí zh-Hans:3夜总会|娱乐 zh-Hant:1夜店|2俱樂部|酒|喝酒|跳舞|舞|2夜生活|娛樂 -sk:4Nočný klub|3disco|3nightclub|zábava +sk:4Nočný klub|3disco|3nightclub|night club|zábava sw:Ukumbi wa starehe|klabu|burudani amenity-brothel diff --git a/search/search_integration_tests/processor_test.cpp b/search/search_integration_tests/processor_test.cpp index e511ddad71..15576e14f8 100644 --- a/search/search_integration_tests/processor_test.cpp +++ b/search/search_integration_tests/processor_test.cpp @@ -788,5 +788,30 @@ UNIT_CLASS_TEST(ProcessorTest, FuzzyMatch) TEST(ResultsMatch("моксва ленинргадский черчиль", "ru", rules), ()); } } + +UNIT_CLASS_TEST(ProcessorTest, SpacesInCategories) +{ + string const countryName = "Wonderland"; + TestCountry country(m2::PointD(10, 10), countryName, "en"); + + TestCity city(m2::PointD(5.0, 5.0), "Москва", "ru", 100 /* rank */); + TestPOI nightclub(m2::PointD(5.0, 5.0), "Crasy daizy", "ru"); + nightclub.SetTypes({{"amenity", "nightclub"}}); + + BuildWorld([&](TestMwmBuilder & builder) { + builder.Add(country); + builder.Add(city); + }); + + auto id = BuildCountry(countryName, [&](TestMwmBuilder & builder) { builder.Add(nightclub); }); + + { + TRules rules = {ExactMatch(id, nightclub)}; + TEST(ResultsMatch("nightclub", "en", rules), ()); + TEST(ResultsMatch("night club", "en", rules), ()); + TEST(ResultsMatch("n i g h t c l u b", "en", TRules{}), ()); + TEST(ResultsMatch("Москва ночной клуб", "ru", rules), ()); + } +} } // namespace } // namespace search