Given two strings, returns the Levenshtein distance between those strings. The Levenshtein distance is a measure of how many operations it takes to transform a string into another string, and it is useful in determining if a word is spelled correctly, or in simply comparing how "different" two words are.
|$str1||The first input string.|
|$str2||The second input string.|
spell:levenshtein-distance function is a built-in
function and does not require the
import module statement
in the XQuery prolog.
spell:levenshtein-distance function throws an exception
if one of the strings is 64 or more characters in length and the other
is at least 1 character in length.
spell.levenshteinDistance("albatros","albetros"); => 1
spell.levenshteinDistance("cat", "cats"); => 1