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

Function GetResult

libs/base/base_tests/levenshtein_dfa_test.cpp:63–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61}
62
63Result GetResult(LevenshteinDFA const & dfa, std::string const & s)
64{
65 auto it = dfa.Begin();
66 DFAMove(it, s);
67 if (it.Accepts())
68 return Result(Status::Accepts, it.ErrorsMade(), it.PrefixErrorsMade());
69 if (it.Rejects())
70 return Result(Status::Rejects, it.ErrorsMade(), it.PrefixErrorsMade());
71 return Result(Status::Intermediate, it.ErrorsMade(), it.PrefixErrorsMade());
72}
73
74bool Accepts(LevenshteinDFA const & dfa, std::string const & s)
75{

Callers 4

AcceptsFunction · 0.85
RejectsFunction · 0.85
IntermediateFunction · 0.85
UNIT_TESTFunction · 0.85

Calls 7

DFAMoveFunction · 0.85
ResultClass · 0.70
BeginMethod · 0.45
AcceptsMethod · 0.45
ErrorsMadeMethod · 0.45
PrefixErrorsMadeMethod · 0.45
RejectsMethod · 0.45

Tested by

no test coverage detected