9 const std::string &
string,
57std::optional<std::size_t>
61 for(
const auto c : string)
65 for(std::size_t distance = 0; distance <
final_states.size(); ++distance)
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
levenshtein_automatont(const std::string &string, std::size_t allowed_errors=2)
std::optional< std::size_t > get_edit_distance(const std::string &string) const
bool matches(const std::string &string) const
std::vector< state_labelt > final_states
statet initial_state(state_labelt initial) const
statet next_state(const statet ¤t, const T &input) const
void add_arbitrary_transition(state_labelt from, state_labelt to)
Add a transition from "from" to "to" when any input is consumed This is handled a special case so not...
void add_transition(state_labelt from, T when, state_labelt to)
Add a transition from "from" to "to" exactly when "when" is consumed.
void add_epsilon_transition(state_labelt from, state_labelt to)
Add a transition from "from" to "to" that doesn’t consume input.