DIAdem Help

Content Type
Programming Language
Current manual
Table of Contents

Command: LevenshteinDist

Display all  Hide all

Command: LevenshteinDist

Specifies the Levenshtein distance which is a value for the difference between two texts.

ReturnValue = LevenshteinDist(TxtValue, TxtValue)

Input Parameters

TxtValue Specifies a text.
TxtValue Specifies a text.

Return Parameters

ReturnValue The return value is an Integer variable type.

In information theory, the Levenshtein distance describes a value for the difference regarding the minimum number of insert, delete, or replace operations between two strings, in order to transfer one string into the other string.

For example, to get from Diadem to Dialog Box three replacements and four insert operations are necessary which means the Levenshtein distance is 7:

  1. "Diadem"
  2. "Dialem" (replace d with l)
  3. "Dialom" (replace e with o)
  4. "Dialog" (replace m with g)
  5. "Dialog " (insert a blank)
  6. "Dialog B" (insert B)
  7. "Dialog Bo" (insert o)
  8. "Dialog Box" (insert x)

The Levenshtein distance determines the similarity between strings, for example, in the spelling correction or duplicate detection.

Was this information helpful?