From dc8301904fc7ea64e768666d7430e9a67d80f9ef Mon Sep 17 00:00:00 2001 From: Maxim Pimenov Date: Wed, 21 Dec 2016 15:48:53 +0300 Subject: [PATCH 1/3] [search] Support hyphen in the Wi-Fi category. The bug was noticed by jancborchardt here: https://github.com/mapsme/omim/issues/5070. --- data/categories.txt | 50 +++++++++---------- indexer/categories_holder.cpp | 4 +- .../processor_test.cpp | 2 + 3 files changed, 30 insertions(+), 26 deletions(-) diff --git a/data/categories.txt b/data/categories.txt index a748cc5866..4137680f45 100644 --- a/data/categories.txt +++ b/data/categories.txt @@ -5565,35 +5565,35 @@ sk:Oceán sw:Bahari @wifi -en:WiFi -ru:WiFi +en:WiFi|Wi-Fi +ru:WiFi|Wi-Fi ar:وايفاي -cs:WiFi -da:WiFi -nl:WiFi -fi:WiFi -fr:WiFi -de:WLAN|WiFi -hu:WiFi -id:WiFi -it:WiFi +cs:WiFi|Wi-Fi +da:WiFi|Wi-Fi +nl:WiFi|Wi-Fi +fi:WiFi|Wi-Fi +fr:WiFi|Wi-Fi +de:WLAN|WiFi|Wi-Fi +hu:WiFi|Wi-Fi +id:WiFi|Wi-Fi +it:WiFi|Wi-Fi ja:無線LAN -ko:WiFi인터넷|WiFi 인터넷 -nb:WiFi -pl:WiFi -pt:WiFi -ro:WiFi -es:WiFi -sv:WiFi -th:WiFi -tr:WiFi -uk:WiFi -vi:WiFi +ko:WiFi인터넷|WiFi 인터넷|Wi-Fi인터넷|Wi-Fi 인터넷 +nb:WiFi|Wi-Fi +pl:WiFi|Wi-Fi +pt:WiFi|Wi-Fi +ro:WiFi|Wi-Fi +es:WiFi|Wi-Fi +sv:WiFi|Wi-Fi +th:WiFi|Wi-Fi +tr:WiFi|Wi-Fi +uk:WiFi|Wi-Fi +vi:WiFi|Wi-Fi zh-Hans:无线网络 zh-Hant:無線網路 -el:WiFi -sk:WiFi -sw:WiFi +el:WiFi|Wi-Fi +sk:WiFi|Wi-Fi +sw:WiFi|Wi-Fi internet_access|internet_access-wlan|@wifi en:3^Internet|U+1F4F6 diff --git a/indexer/categories_holder.cpp b/indexer/categories_holder.cpp index 793cbc8f41..df6eed5ad5 100644 --- a/indexer/categories_holder.cpp +++ b/indexer/categories_holder.cpp @@ -225,9 +225,11 @@ bool CategoriesHolder::ValidKeyToken(StringT const & s) return true; /// @todo We need to have global stop words array for the most used languages. - for (char const * token : {"a", "z", "s", "d", "di", "de", "le", "wi", "fi", "ra", "ao"}) + for (char const * token : {"a", "z", "s", "d", "di", "de", "le", "ra", "ao"}) + { if (s.IsEqualAscii(token)) return false; + } return true; } diff --git a/search/search_integration_tests/processor_test.cpp b/search/search_integration_tests/processor_test.cpp index 15576e14f8..ee0e767224 100644 --- a/search/search_integration_tests/processor_test.cpp +++ b/search/search_integration_tests/processor_test.cpp @@ -673,6 +673,8 @@ UNIT_CLASS_TEST(ProcessorTest, TestCategories) TEST(ResultsMatch("#void-", TRules{}), ()); TEST(ResultsMatch("wifi", {ExactMatch(wonderlandId, cafe)}), ()); + TEST(ResultsMatch("wi-fi", {ExactMatch(wonderlandId, cafe)}), ()); + TEST(ResultsMatch("wai-fai", TRules{}), ()); TEST(ResultsMatch("toilet", {ExactMatch(wonderlandId, toi)}), ()); TEST(ResultsMatch("beach ", {ExactMatch(wonderlandId, nonameBeach), ExactMatch(wonderlandId, namedBeach)}), From 5b5d28509c3d9adcbbd62f9ea3561799563fd047 Mon Sep 17 00:00:00 2001 From: Maxim Pimenov Date: Wed, 21 Dec 2016 17:51:56 +0300 Subject: [PATCH 2/3] [strings] Made the hyphenation on the Wi-Fi/WiFi label consistent across the languages. --- strings.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/strings.txt b/strings.txt index c83137e248..9635449f65 100644 --- a/strings.txt +++ b/strings.txt @@ -7237,7 +7237,7 @@ [wifi] comment = Search Suggestion tags = ios,android,tizen - en = Wi-Fi + en = WiFi ru = WiFi ar = واي فاي cs = WiFi From 5308702fff587785cef6d10d446d872fa2ad0619 Mon Sep 17 00:00:00 2001 From: Maxim Pimenov Date: Wed, 21 Dec 2016 17:52:25 +0300 Subject: [PATCH 3/3] Regenerated strings. --- android/res/values/strings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/res/values/strings.xml b/android/res/values/strings.xml index b061b55318..3f99e502d9 100644 --- a/android/res/values/strings.xml +++ b/android/res/values/strings.xml @@ -423,7 +423,7 @@ Compass calibration - Wi-Fi + WiFi Please update the map to create a route