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

Method Move

libs/base/levenshtein_dfa.cpp:347–360  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

345}
346
347size_t LevenshteinDFA::Move(size_t s, UniChar c) const
348{
349 ASSERT_GREATER(m_alphabet.size(), 0, ());
350 ASSERT(is_sorted(m_alphabet.begin(), m_alphabet.end() - 1), ());
351
352 size_t i;
353 auto const it = lower_bound(m_alphabet.begin(), m_alphabet.end() - 1, c);
354 if (it == m_alphabet.end() - 1 || *it != c)
355 i = m_alphabet.size() - 1;
356 else
357 i = distance(m_alphabet.begin(), it);
358
359 return m_transitions[s][i];
360}
361
362std::string DebugPrint(LevenshteinDFA::Position const & p)
363{

Callers 5

IteratorClass · 0.45
IteratorClass · 0.45
DFAMoveFunction · 0.45
LevenshteinDFAMethod · 0.45
UNIT_TESTFunction · 0.45

Calls 5

ASSERTFunction · 0.85
distanceFunction · 0.85
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by 1

UNIT_TESTFunction · 0.36