string.similarity(str1, str2)

Calculate the similarity between two strings, using Levenshtein distance algorithm.

Parameters

str1, str2

The strings to be evaluated for similiarity.

Return value

Returns a number between 0 (no similarity at all) and 100 (strings are the same)

Example

local word = "bird" -- outputs 60 print("Similarity between 'bird' and 'bread' : "..word:similarity('bread'))