Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
val start : k:int -> str:string -> nfa_state
start ~k ~str
produces the starting state of the automaton for edit distance k
. Here k
must not be negative and must not be greater (Sys.int_size - 1) / 2
.
feed nfa ch
produces a new state where the automaton has been fed the character ch
.
val current_error : nfa_state -> int option
current_error nfa
produces Some n
if the current error count recorded by the nfa is a number n
, or None
if the error count is larger than the limit k
that the nfa was started with. current_error nfa
may be smaller than end_input nfa
, since it does not account for delete operations at the end of the fed string.
val end_input : nfa_state -> int option
end_input nfa
computes the edit distance between the starting string and the string fed to nfa
. It produces Some n
if the edit distance in a number n
that is less than the limit k
that the automaton was started with, and None
otherwise.
feed_str nfa ~str
produces a new state where the automaton has been fed the characters from the string str
.