March 2002
Intermediate to advanced
528 pages
21h 29m
English
levenshtein
int levenshtein(stringone, stringtwo[, intinsert, intreplace, intdelete]) int levenshtein(stringone, stringtwo[, mixedcallback])
Calculates the Levenshtein distance between two strings; this is the
number of characters you have to replace, insert, or delete to
transform one into
two. By default, replacements, inserts,
and deletes have the same cost, but you can specify different costs
with insert,
replace, and
delete. In the second form, you provide a
callback to calculate the cost of an operation.