Next: , Up: levenshtein   [Index]


30.1 Basic comparisons

In the current implementation, all comparisons are done internally via vectors.

Function: vector-levenshtein/predicate/get-scratch a b pred get-scratch

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.

Function: vector-levenshtein/predicate a b pred
Function: vector-levenshtein/eq a b
Function: vector-levenshtein/eqv a b
Function: vector-levenshtein/equal a b
Function: vector-levenshtein a b

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
Function: list-levenshtein/predicate a b pred
Function: list-levenshtein/eq a b
Function: list-levenshtein/eqv a b
Function: list-levenshtein/equal a b
Function: list-levenshtein a b

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
Function: string-levenshtein a b

Calculate the Levenshtein Distance of strings a and b.

(string-levenshtein "adresse" "address") ⇒ 2

Next: , Up: levenshtein   [Index]