This package provides implementations of the Levenshtein, Damerau-
Levenshtein, and weighted edit distance for strings as well as key lists
(i.e. cell arrays of strings or arbitrary other elements).
This code is part of the work described in . In , edit distances are
applied to match linguistic descriptions that occur when referring to objects
(in order to achieve joint attention in spoken human-robot / human-human
 B. Schauerte, G. A. Fink, "Focusing Computational Visual Attention
in Multi-Modal Human-Robot Interaction," in Proc. ICMI, 2010.
I also get incorrect l-d distances when transpositions are involved. Error is on line 76 of edit_distance_damerau.m, which should read:
d(i-2,j-2) + cost, ...
Note the " + cost" was missing. There is a similar error in the edit_distance_damerau_keylist.m file
In the transposition part, "d(i-2,j-2)" should be "d(i-1,j-1)", otherwise cumulative costs don't carry forward.
I get incorrect values for a swap with levenshtein-damerau:
14> edit_distance_damerau('smtih', 'smith')
ans = 0
ans should be 1, with the swapping of "ti"
Otherwise nice code -- I am using it to understand this algorithm
- moved to Github
- extended the interface of the cell array functions: now you can use arbitrary compare functions and cell content
- updated the description
- bugfix (thanks for the helpful comments of "forkandwait w")
Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.