mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-20 13:23:59 +00:00
Organic Maps sources as of 02.04.2025 (fad26bbf22ac3da75e01e62aa01e5c8e11861005)
To expand with full Organic Maps and Maps.ME commits history run: git remote add om-historic [om-historic.git repo url] git fetch --tags om-historic git replace squashed-history historic-commits
This commit is contained in:
46
search/approximate_string_match.cpp
Normal file
46
search/approximate_string_match.cpp
Normal file
@@ -0,0 +1,46 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user