From 2d0a7561703ca5d01dd3d11c20ba687eb939c042 Mon Sep 17 00:00:00 2001 From: Viktor Govako Date: Sat, 9 Sep 2023 11:19:54 -0300 Subject: [PATCH] [search] Simplify apostrophe. Signed-off-by: Viktor Govako --- indexer/indexer_tests/search_string_utils_test.cpp | 5 +++++ indexer/search_string_utils.cpp | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/indexer/indexer_tests/search_string_utils_test.cpp b/indexer/indexer_tests/search_string_utils_test.cpp index 94fe07f1ad..b5e24a972c 100644 --- a/indexer/indexer_tests/search_string_utils_test.cpp +++ b/indexer/indexer_tests/search_string_utils_test.cpp @@ -282,4 +282,9 @@ UNIT_TEST(NormalizeAndSimplifyString_Numero) TEST_EQUAL(NormalizeAndSimplifyStringUtf8("Area #One"), "area #one", ()); } +UNIT_TEST(NormalizeAndSimplifyString_Apostrophe) +{ + TEST_EQUAL(NormalizeAndSimplifyStringUtf8("Pop’s"), "pop's", ()); +} + } // namespace search_string_utils_test diff --git a/indexer/search_string_utils.cpp b/indexer/search_string_utils.cpp index e525ce2309..270522a5e7 100644 --- a/indexer/search_string_utils.cpp +++ b/indexer/search_string_utils.cpp @@ -130,6 +130,10 @@ UniString NormalizeAndSimplifyString(std::string_view s) c = 'a'; uniString.insert(uniString.begin() + (i++) + 1, 'e'); break; + case 0x2018: // ‘ + case 0x2019: // ’ + c = '\''; + break; case 0x2116: // № c = '#'; break;