Get from Ico-github-logo

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
edit distances

  • edit_distance_levenshtein...
  • edit_distance_levenshtein...
  • edit_distance_levenshtein...
  • edit_distance_osa(s,t)
  • edit_distance_osa_keylist...
  • edit_distance_weighted(s,...
  • edit_distance_weighted_ke...
  • examples.m
    % Information
  • View all files
3.0 | 1 rating Rate this file 8 Downloads (last 30 days) File Size: 125 KB File ID: #32449 Version: 1.4

edit distances



06 Aug 2011 (Updated )

Edit distances for strings and key lists (i.e. cell arrays of strings or other elements).

| Watch this File

File Information

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 [1]. In [1], 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

  [1] B. Schauerte, G. A. Fink, "Focusing Computational Visual Attention
      in Multi-Modal Human-Robot Interaction," in Proc. ICMI, 2010.


MATLAB release MATLAB 7.9 (R2009b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (3)
29 Apr 2014 dave

dave (view profile)

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

19 Aug 2011 forkandwait w

In the transposition part, "d(i-2,j-2)" should be "d(i-1,j-1)", otherwise cumulative costs don't carry forward.

Comment only
19 Aug 2011 forkandwait w

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

Comment only
19 Aug 2011 1.1

- bugfix (thanks for the helpful comments of "forkandwait w")

10 Dec 2011 1.2

- updated the description

19 Nov 2012 1.3

- extended the interface of the cell array functions: now you can use arbitrary compare functions and cell content
- added a simple usage example

17 Aug 2015 1.4

- moved to Github
- fixed Damerau
- added example

Contact us