Levenshtein distance: Difference between revisions

Content added Content deleted
(Add CLU)
Line 2,106: Line 2,106:
Frink has a built-in function to calculate the Levenshtein edit distance between two strings:
Frink has a built-in function to calculate the Levenshtein edit distance between two strings:
<lang frink>println[editDistance["kitten","sitting"]]</lang>
<lang frink>println[editDistance["kitten","sitting"]]</lang>
It also has a function to calculate the Levenshtein-Damerau edit distance, <CODE>editDistanceDamerau[<I>str1</I>,<I>str2</I>]</CODE>. This is similar to the <CODE>editDistance</CODE> function but also allows ''swaps'' between two adjoining characters, which count as an edit distance of 1. This may make distances between some strings shorter, by say, treating transposition errors in a word as a less expensive operation than in the pure Levenshtein algorithm, and is generally more useful in more circumstances.


=={{header|FutureBasic}}==
=={{header|FutureBasic}}==