context
.levenshtein
Generate a transducer encoding the Levenshtein distance for two alphabets.
The resulting transducer can be composed with transducers representing two languages to compute the distance between the two languages (among other things, like the edit-distance automaton).
Preconditions:
the labelset has exactly two tapes
the labelsets must have the empty word
the weightset must be
nmin
()
References:
mohri.2002.ciaa for more details on the edit-distance automaton
Examples
The Levenshtein automaton only has one state, but has transitions, for a common alphabet between tapes of size .
To show its use, we will create automata for two languages, a1
and a2
, and compute the edit-distance automaton.
The automaton can be evaluated on one tape to get the edit distance between a word and a language.