|
|
|
Home / Open source / Terimber 2.0
fuzzyphonetic Namespace Referencefuzzy match library implementation
More...
|
Classes |
class | metaphone_keeper |
Functions |
metaphone_key | convert_to_metaphone (const char *word,size_t len,byte_allocator &all) |
| converts a single word to the phonetic key memory is allocated on an external allocator
|
void | convert_to_reflection (const char *word,size_t len,byte_allocator &all,reflection_key &reflection) |
| converts phrase to reflection
|
char | to_upper (char ch) |
| converts the char to upper case
|
char | to_lower (char ch) |
| converts the char to lower case
|
template<class T> |
size_t | metaphone_distance (const T *ax, size_t x, const T *ay, size_t y, byte_allocator &tmp, size_t max_penalty) |
| calculates the matrix distance
|
size_t | find_metaphone_distance (const metaphone_key &x, const metaphone_key &y, byte_allocator &tmp, size_t max_penalty) |
| finds the distance between the two metaphone keys
|
size_t | find_reflection_distance (const reflection_key &x, const reflection_key &y, byte_allocator &tmp, size_t max_penalty) |
| finds the distance between the two reflection keys
|
size_t | find_word_distance (const char *x, size_t xlen, const char *y, size_t ylen, byte_allocator &tmp, size_t max_penalty) |
| finds the distance between the two words
|
bool | is_legal_char (char ch) |
bool | is_vowel (char ch) |
bool | check_sub_string (const char *word, const char *pend, const char *ethalon, size_t len) |
bool | is_slavo_germanic (const char *word, size_t len) |
size_t | find_key_distance (const metaphone_key &x, const metaphone_key &y, byte_allocator &tmp) |
Variables |
const ub1_t | empty_code = 0xff |
const ub1_t | blank_code = 0xfe |
const ub1_t | H_NOTE = 0 |
const ub1_t | TH_NOTE = 1 |
const ub1_t | F_NOTE = 2 |
const ub1_t | P_NOTE = 3 |
const ub1_t | T_NOTE = 4 |
const ub1_t | K_NOTE = 5 |
const ub1_t | S_NOTE = 6 |
const ub1_t | X_NOTE = 7 |
const ub1_t | B_NOTE = 8 |
const ub1_t | N_NOTE = 9 |
const ub1_t | L_NOTE = 10 |
const ub1_t | M_NOTE = 11 |
const ub1_t | W_NOTE = 12 |
const ub1_t | Y_NOTE = 13 |
const ub1_t | R_NOTE = 14 |
const ub1_t | J_NOTE = 15 |
const ub1_t | A_NOTE = 16 |
const ub1_t | legal_mask = 0x10 |
const ub1_t | metaphoneic_mask = 0x0F |
const ub1_t | lower_mask = 0x20 |
const ub1_t | vowel_mask = 0x40 |
static const ub1_t | metaphoneic_rules [256] |
Detailed Description
fuzzy match library implementation
Function Documentation
bool fuzzyphonetic::check_sub_string |
( |
const char * |
word, |
|
|
const char * |
pend, |
|
|
const char * |
ethalon, |
|
|
size_t |
len | |
|
) |
| | [inline] |
converts a single word to the phonetic key memory is allocated on an external allocator
- Parameters:
-
word |
input word |
len |
word length |
all |
external allocator |
Definition at line 212 of file fuzzyphonetic.cpp.
References fuzzyphonetic::metaphone_keeper::_alt, metaphone_key::_array, fuzzyphonetic::metaphone_keeper::_code, metaphone_key::_length, A_NOTE, byte_allocator::allocate(), base_list< T >::begin(), blank_code, check_sub_string(), fuzzyphonetic::metaphone_keeper::clear(), empty_code, base_list< T >::end(), F_NOTE, H_NOTE, is_slavo_germanic(), is_vowel(), J_NOTE, K_NOTE, L_NOTE, M_NOTE, fuzzyphonetic::metaphone_keeper::metaph_add(), fuzzyphonetic::metaphone_keeper::metaph_add_alt(), N_NOTE, P_NOTE, R_NOTE, S_NOTE, _list< T, A >::size(), T_NOTE, TH_NOTE, to_upper(), and X_NOTE.
Referenced by fuzzy_matcher_impl::_match(), fuzzy_matcher_impl::add(), and convert_to_reflection().
size_t fuzzyphonetic::find_word_distance |
( |
const char * |
x, |
|
|
size_t |
xlen, |
|
|
const char * |
y, |
|
|
size_t |
ylen, |
|
|
byte_allocator & |
tmp, |
|
|
size_t |
max_penalty | |
|
) |
| | [inline] |
bool fuzzyphonetic::is_legal_char |
( |
char |
ch |
) |
[inline] |
bool fuzzyphonetic::is_slavo_germanic |
( |
const char * |
word, |
|
|
size_t |
len | |
|
) |
| | [inline] |
bool fuzzyphonetic::is_vowel |
( |
char |
ch |
) |
[inline] |
template<class T>
size_t fuzzyphonetic::metaphone_distance |
( |
const T * |
ax, |
|
|
size_t |
x, |
|
|
const T * |
ay, |
|
|
size_t |
y, |
|
|
byte_allocator & |
tmp, |
|
|
size_t |
max_penalty | |
|
) |
| | [inline] |
char fuzzyphonetic::to_lower |
( |
char |
ch |
) |
[inline] |
char fuzzyphonetic::to_upper |
( |
char |
ch |
) |
[inline] |
Variable Documentation
|
|
|
|