String Distance
Distance Between Two Strings

Examples

Here is an example that shows the basic use of the package.

local d = require"stringdistance"

print("Testing levenshtein distance")

local s = "Soletrando"
local t = "soletranod"

-- Using levenshtein 
local dl = d.lev(s,t)
-- dl = 3

-- Using damerau-levenshtein 
local dd = d.dam(s,t)
-- dd = 2

Valid XHTML 1.0!

$Id: examples.html,v 1.5 2011-12-21 13:35:37 tomas Exp $