[search] Use spaces in synonyms. Do map whole synonym string and separate tokens.

Fix.
This commit is contained in:
vng 2012-03-05 00:11:19 +03:00 committed by Alex Zolotarev
parent d57815a04d
commit 5fe11e0b5e
3 changed files with 1 additions and 17 deletions

View file

@ -45,7 +45,7 @@ void CategoriesHolder::AddCategory(Category & cat, vector<uint32_t> & types)
StringT const uniName = search::NormalizeAndSimplifyString(p->m_synonyms[i].m_name);
vector<StringT> tokens;
SplitUniString(uniName, MakeBackInsertFunctor(tokens), search::CategoryDelimiters());
SplitUniString(uniName, MakeBackInsertFunctor(tokens), search::Delimiters());
for (size_t j = 0; j < tokens.size(); ++j)
for (size_t k = 0; k < types.size(); ++k)

View file

@ -60,14 +60,4 @@ bool Delimiters::operator()(strings::UniChar c) const
return false;
}
bool CategoryDelimiters::operator()(strings::UniChar c) const
{
// In categories.txt we use '-' as a delimeter.
// Do not skip this.
if (c == '-')
return false;
return Delimiters::operator()(c);
}
}

View file

@ -9,10 +9,4 @@ namespace search
public:
bool operator()(strings::UniChar c) const;
};
class CategoryDelimiters : public Delimiters
{
public:
bool operator()(strings::UniChar c) const;
};
}