Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvng <viktor.govako@gmail.com>2015-08-18 17:31:14 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 03:01:35 +0300
commit298a5965ee32eaabe97b671b262584a48fd8c33a (patch)
tree9db10ff1839650ed537f5222c6f7246ce26c0589 /indexer/search_string_utils.hpp
parentfb7e49b8285f92eb796a8a156461eeba5bbcbb83 (diff)
[search] Ignore accents in string matching.
Diffstat (limited to 'indexer/search_string_utils.hpp')
-rw-r--r--indexer/search_string_utils.hpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/indexer/search_string_utils.hpp b/indexer/search_string_utils.hpp
index 86c9b10092..f131bb73a4 100644
--- a/indexer/search_string_utils.hpp
+++ b/indexer/search_string_utils.hpp
@@ -46,6 +46,15 @@ inline strings::UniString NormalizeAndSimplifyString(string const & s)
MakeLowerCaseInplace(uniString);
NormalizeInplace(uniString);
+
+ // Remove accents that can appear after NFKD normalization.
+ uniString.erase_if([](UniChar const & c)
+ {
+ // ̀ COMBINING GRAVE ACCENT
+ // ́ COMBINING ACUTE ACCENT
+ return (c == 0x0300 || c == 0x0301);
+ });
+
return uniString;
/// @todo Restore this logic to distinguish и-й in future.