Levenshtein Distance

From UBot Studio
Revision as of 16:24, 14 June 2015 by LillyT (Talk | contribs)

Jump to: navigation, search

This function is an Advanced Text function in the UBot Extended Library. This function calculates levenshtein distance between two strings.

First String: The first string in the comparison.

Second String: The second string in the comparison.

To read more about the purpose of the levenshtein distance, [please see here|http://people.cs.pitt.edu/~kirk/cs1501/Pruhs/Fall2006/Assignments/editdistance/Levenshtein%20Distance.htm].

Example 1


alert($levenshtein distance(300,900))


Running the alert command will produce the levenshtein distance between the numbers 300 and 900, which is 1.


Levdis.jpg


Example 2


alert($levenshtein distance("rosettacode","raisethysword"))


Running the alert command will produce the levenshtein distance between the strings "rosettacode" and "raisethysword", which is 8.


Levdis1.jpg

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox