EditDistance

EditDistance[u,v]

gives the edit or Levenshtein distance between strings or vectors u and v.

Details and Options

  • EditDistance[u,v] gives the number of one-element deletions, insertions, and substitutions required to transform u to v.
  • For strings, setting the option IgnoreCase->True makes EditDistance treat lower and uppercase letters as equivalent.

Examples

open allclose all

Basic Examples  (2)

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]=

Scope  (2)

Options  (1)

Applications  (2)

Properties & Relations  (2)

See Also

DamerauLevenshteinDistance  HammingDistance  SmithWatermanSimilarity  StringCount  JaccardDissimilarity  Nearest  CentralFeature

Tutorials

Introduced in 2007
(6.0)