February 2013
Intermediate to advanced
538 pages
20h 55m
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, just the
total cost of inserts, replaces, and deletes are returned, not broken
down.
Read now
Unlock full access