edistnorm(X;Y)

Returns the normalized Levenshtein edit distance between two given strings.

Syntax

edistnorm(X;Y)

Input

Argument Type Description
X text The string on which to apply the function

A column name

Y text The name of column containing string values to transform X into

Return Value

The result is the decimal value corresponding to the value of editdist(X;Y) divided by the length of the longer of X and Y.

If X and Y are both N/A, the result is N/A. If either is N/A (but not both), the result is 1.

Sample Usage

value1 value2 edistnorm(value1;value2)
'cat' 'rat' 0.333333333333333
'apples' 'oranges' 0.714285714285714
'apples' 'apples' 0

Additional Information

  • This function does not work with Unicode (UTF-8) strings.
  • For a Unicode-compliant alternative, consider strdist(X;Y;M;N).