This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

EditDistance

EditDistance
gives the edit or Levenshtein distance between strings or vectors u and v.
  • EditDistance gives the number of one-element deletions, insertions, and substitutions required to transform u to v.
Edit distance between two strings:
Edit distance between two vectors:
Edit distance between two strings:
In[1]:=
Click for copyable input
Out[1]=
 
Edit distance between two vectors:
In[1]:=
Click for copyable input
Out[1]=
Compute distance between strings of unequal length:
Compute distance between vectors of any length:
Obtain edit distance ignoring case of letters:
Cluster string data using edit distance:
Cluster numeric data using edit distance:
EditDistance is less than or equal to HammingDistance for strings of equal length:
EditDistance is less than or equal to HammingDistance for vectors of equal length:
New in 6