forked from organicmaps/organicmaps
[search] '-' is not a delimiter in categories. We use it as a separator.
This commit is contained in:
parent
2ff43f26b7
commit
f541b83d13
3 changed files with 21 additions and 7 deletions
|
@ -60,4 +60,14 @@ 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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -4,11 +4,15 @@
|
|||
|
||||
namespace search
|
||||
{
|
||||
class Delimiters
|
||||
{
|
||||
public:
|
||||
bool operator()(strings::UniChar c) const;
|
||||
};
|
||||
|
||||
class Delimiters
|
||||
{
|
||||
public:
|
||||
bool operator()(strings::UniChar c) const;
|
||||
};
|
||||
|
||||
class CategoryDelimiters : public Delimiters
|
||||
{
|
||||
public:
|
||||
bool operator()(strings::UniChar c) const;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ void Engine::InitializeCategoriesAndSuggestStrings(CategoriesHolder const & cate
|
|||
score = name.m_prefixLengthToSuggest;
|
||||
|
||||
vector<strings::UniString> tokens;
|
||||
SplitUniString(uniName, MakeBackInsertFunctor(tokens), Delimiters());
|
||||
SplitUniString(uniName, MakeBackInsertFunctor(tokens), CategoryDelimiters());
|
||||
for (size_t j = 0; j < tokens.size(); ++j)
|
||||
for (size_t k = 0; k < it->m_types.size(); ++k)
|
||||
m_pData->m_categories.insert(make_pair(tokens[j], it->m_types[k]));
|
||||
|
|
Loading…
Add table
Reference in a new issue