The data structures JAR comes packaged with serialized instances of distance 1, 2, and 3 LevenshteinAutomaton. This saves developers the time and processing power of generating their own automata. The real speed behing a Levenshtein automaton is best realized when the generation of the automaton is done prior to error correction.
However, generating instances of LevenshteinAutomaton can be done by the developer. Note: distances greater than 3 may require extremely large heap spaces.
The serialized LevenshteinAutomaton is written to the current working directory.
The first step to using a LevenshteinAutomaton for error correction is to organize the list of known, correct strings into a dictionary. This implementation requires all strings to be stored in an instance of the DictionaryAutomaton class.
The second step is to load a pre-generated instance of LevenshteinAutomaton.
The final step is to call the recognize method of the LevenshteinAutomaton, passing in the DictionaryAutomaton and the candidate string.