Welcome to mirror list, hosted at ThFree Co, Russian Federation.

utils.cpp « search - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c584dc9d305b905cdebdea64a45223032fbacbcc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "search/utils.hpp"

#include <cctype>

namespace search
{
size_t GetMaxErrorsForToken(strings::UniString const & token)
{
  bool const digitsOnly = std::all_of(token.begin(), token.end(), ::isdigit);
  if (digitsOnly)
    return 0;
  if (token.size() < 4)
    return 0;
  if (token.size() < 8)
    return 1;
  return 2;
}
}  // namespace search