[search] Remove stop words

Signed-off-by: x7z4w <x7z4w@noreply.codeberg.org>
This commit is contained in:
x7z4w
2025-11-10 19:44:34 +00:00
parent 4f7230fcbe
commit 71b47719af
8 changed files with 15 additions and 78 deletions

View File

@@ -1482,13 +1482,7 @@ unordered_map<string, vector<string>> const kSynonyms = {
// QueryParams::Token ------------------------------------------------------------------------------
void QueryParams::Token::AddSynonym(string const & s)
{
AddSynonym(strings::MakeUniString(s));
}
void QueryParams::Token::AddSynonym(String const & s)
{
if (!IsStopWord(s))
m_synonyms.push_back(s);
m_synonyms.push_back(strings::MakeUniString(s));
}
string DebugPrint(QueryParams::Token const & token)
@@ -1510,10 +1504,11 @@ void QueryParams::ClearStreetIndices()
AdditionalCommonTokens()
{
char const * arr[] = {
"the", // English
"der", "zum", "und", "auf", // German
"del", "les", // Spanish
"в", "на" // Cyrillic
"a", "and", "s", "the", // English
"am", "an", "auf", "der", "im", "und", "zum", // German
"as", "d", "da", "de", "del", "di", "do", "du", "e", "el",
"et", "la", "las", "le", "les", "los", "o", "os", "y", // French, Spanish, Italian
"в", "и", "на", "я" // Cyrillic
};
for (char const * s : arr)
m_strings.insert(NormalizeAndSimplifyString(s));