MCPcopy Create free account
hub / github.com/comaps/comaps / BuildLevenshteinDFA

Function BuildLevenshteinDFA

libs/indexer/search_string_utils.cpp:157–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155}
156
157LevenshteinDFA BuildLevenshteinDFA(UniString const & s)
158{
159 ASSERT(!s.empty(), ());
160 // In search we use LevenshteinDFAs for fuzzy matching. But due to
161 // performance reasons, we limit prefix misprints to fixed set of substitutions defined in
162 // kAllowedMisprints and skipped letters.
163 return LevenshteinDFA(s, 1 /* prefixSize */, kAllowedMisprints, GetMaxErrorsForToken(s));
164}
165
166LevenshteinDFA BuildLevenshteinDFA_Category(UniString const & s)
167{

Callers 8

GetTopLocalitiesMethod · 0.85
TokensVectorClass · 0.85
FillRequestFromTokenFunction · 0.85
UNIT_TESTFunction · 0.85
GetErrorsMadeFunction · 0.85
GetPrefixErrorsMadeFunction · 0.85

Calls 4

ASSERTFunction · 0.85
GetMaxErrorsForTokenFunction · 0.85
LevenshteinDFAClass · 0.50
emptyMethod · 0.45

Tested by 3

UNIT_TESTFunction · 0.68
GetErrorsMadeFunction · 0.68
GetPrefixErrorsMadeFunction · 0.68