EditDistance

EditDistance[u,v]

gives the edit or Levenshtein distance between strings, vectors or biomolecular sequences 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  (3)

Edit distance between two strings:

Edit distance between two vectors:

Edit distance between biomolecular sequences:

Scope  (2)

Compute distance between strings of unequal length:

Compute distance between vectors of any length:

Options  (1)

IgnoreCase  (1)

Obtain edit distance ignoring case of letters:

Applications  (2)

Cluster string data using edit distance:

Cluster numeric data using edit distance:

Properties & Relations  (2)

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:

Wolfram Research (2007), EditDistance, Wolfram Language function, https://reference.wolfram.com/language/ref/EditDistance.html (updated 2020).

Text

Wolfram Research (2007), EditDistance, Wolfram Language function, https://reference.wolfram.com/language/ref/EditDistance.html (updated 2020).

CMS

Wolfram Language. 2007. "EditDistance." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/EditDistance.html.

APA

Wolfram Language. (2007). EditDistance. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/EditDistance.html

BibTeX

@misc{reference.wolfram_2024_editdistance, author="Wolfram Research", title="{EditDistance}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/EditDistance.html}", note=[Accessed: 05-October-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_editdistance, organization={Wolfram Research}, title={EditDistance}, year={2020}, url={https://reference.wolfram.com/language/ref/EditDistance.html}, note=[Accessed: 05-October-2024 ]}