forked from organicmaps/organicmaps-tmp
Review fixes.
This commit is contained in:
parent
ef8f9b155e
commit
46bb0cd9c7
2 changed files with 3 additions and 3 deletions
|
@ -350,9 +350,6 @@ void Geocoder::SetParams(Params const & params)
|
|||
m_tokenRequests.emplace_back();
|
||||
auto & request = m_tokenRequests.back();
|
||||
m_params.GetToken(i).ForEach([&request](UniString const & s) {
|
||||
// Here and below, we use LevenshteinDFAs for fuzzy
|
||||
// matching. But due to performance reasons, we assume that the
|
||||
// first letter is always correct.
|
||||
request.m_names.emplace_back(BuildLevenshteinDFA(s));
|
||||
});
|
||||
for (auto const & index : m_params.GetTypeIndices(i))
|
||||
|
|
|
@ -18,6 +18,9 @@ size_t GetMaxErrorsForToken(strings::UniString const & token)
|
|||
|
||||
strings::LevenshteinDFA BuildLevenshteinDFA(strings::UniString const & s)
|
||||
{
|
||||
// In search we use LevenshteinDFAs for fuzzy matching. But due to
|
||||
// performance reasons, we assume that the first letter is always
|
||||
// correct.
|
||||
return strings::LevenshteinDFA(s, 1 /* prefixCharsToKeep */, GetMaxErrorsForToken(s));
|
||||
}
|
||||
} // namespace search
|
||||
|
|
Loading…
Add table
Reference in a new issue