01-19-2018, 04:29 PM
Macro LevenshteinDistance help
;Computes <link "https://en.wikipedia.org/wiki/Levenshtein_distance">Levenshtein Distance</link> between two strings.
;Also known as fuzzy matching, fuzzy searching, approximate matching.
;Compares two strings and returns 0 if equal, 1 if almost equal, and so on.
;Uses C# code from <link>https://www.dotnetperls.com/levenshtein</link>
;EXAMPLES
#compile "__LevenshteinDistance"
LevenshteinDistance x.Init
;example 1
out x.x.Compute("keyboard" "keyboarf") ;;1
;example 2
str s1="kitten"
str s2="SITTING"
s1.lcase
s2.lcase
int n=x.x.Compute(s1 s2)
out n ;;3