Previous: levenshtein basic, Up: levenshtein [Index]
Procedures levenshtein
and levenshtein/predicate
provide a
convenient interface for comparing a combination of vectors, lists, and
strings, the types of which might not be known until runtime.
Calculate the Levenshtein Distance of two objects a and b, which are vectors, lists, or strings. a and b need not be of the same type. pred is the element equivalence predicate used.
(levenshtein/predicate '#(#\A #\B #\C #\D) "aBXcD" char-ci=?) ⇒ 1
Calculate the Levenshtein Distance of a and b, in a similar
manner as using levenshtein/predicate
with equal?
as the
predicate.
(define g '#(#\g #\u #\m #\b #\o)) (levenshtein g "gambol") ⇒ 2 (levenshtein g "dumbo") ⇒ 1 (levenshtein g "umbrage") ⇒ 5