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

approximate_string_match.cpp « search - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5bda6a2c7d51b8fc0138155cf0414fb778e66679 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include "search/approximate_string_match.hpp"

// TODO: Сделать модель ошибок.
// Учитывать соседние кнопки на клавиатуре.
// 1. Сосед вместо нужной
// 2. Сосед до или после нужной.

namespace search
{

using strings::UniChar;

uint32_t DefaultMatchCost::Cost10(UniChar) const
{
  return 256;
}

uint32_t DefaultMatchCost::Cost01(UniChar) const
{
  return 256;
}

uint32_t DefaultMatchCost::Cost11(UniChar, UniChar) const
{
  return 256;
}

uint32_t DefaultMatchCost::Cost12(UniChar, UniChar const *) const
{
  return 512;
}

uint32_t DefaultMatchCost::Cost21(UniChar const *, UniChar) const
{
  return 512;
}

uint32_t DefaultMatchCost::Cost22(UniChar const *, UniChar const *) const
{
  return 512;
}

uint32_t DefaultMatchCost::SwapCost(UniChar, UniChar) const
{
  return 256;
}

}  // namespace search