Next: levenshtein coerce, Up: levenshtein [Index]
In the current implementation, all comparisons are done internally via vectors.
Few, if any, programs will use this procedure directly. This is like
vector-levenshtein/predicate
, but allows get-scratch to be
specified. get-scratch is a procedure of one term, n, that
yields a vector of length n or greater, which is used for
record-keeping during execution of the Levenshtein algorithm.
make-vector
can be used for get-scratch, although some
programs comparing a large size or quantity of vectors may wish to reuse
a record-keeping vector, rather than each time allocating a new one that
will need to be garbage-collected.
Calculate the Levenshtein Distance of vectors a and b.
pred is the predicate procedure for determining if two elements
are equal. The /eq
, /eqv
, and /equal
variants
correspond to the standard equivalence predicates, eq?
,
eqv?
, and equal?
. vector-levenshtein
is an alias
for vector-levenshtein/equal
.
(vector-levenshtein '#(6 6 6) '#(6 35 6 24 6 32)) ⇒ 3
Calculate the Levenshtein Distance of lists a and b.
pred is the predicate procedure for determining if two elements
are equal. The /eq
, /eqv
, and /equal
variants
correspond to the standard equivalence predicates, eq?
,
eqv?
, and equal?
. list-levenshtein
is an alias for
list-levenshtein/equal
. Note that comparison of lists is less
efficient than comparison of vectors.
(list-levenshtein/eq '(b c e x f y) '(a b c d e f)) ⇒ 4
Calculate the Levenshtein Distance of strings a and b.
(string-levenshtein "adresse" "address") ⇒ 2
Next: levenshtein coerce, Up: levenshtein [Index]