VersionNotice: This page pertains to an earlier version of Lua (4.0 and 5.0beta) using a
loadmodule extension. Lua 5.1 instead uses
require. Lua 5.0 uses
loadmodule("fuzzy") thetext = [[A lnger Text to saerch]] searchstr = "longer" print(fuzzy(thetext,searchstr)) -- gives about 54.54 -- while print(fuzzy(thetext,"lnger")) -- gives 100, a complete match
This Lua extension was built to be used with the 'loadmodule' by IgnacioCastano/ThatcherUlrich LuaBinaryModules
Main goal was to write a 'tutorial' like minimal extension that is completely self-sufficent, only requiring one C source file. The code is based on an [article] in c't 4/97.
A Win32 Lua binary, the compiled luafuzzy.dll along with the source can be downloaded . (updated 2002-11-22 to use the changed luaLM_version() and luaLM_import() names) (updated 2002-11-25 changed to use lua-4.0.dll and lualib-4.0.dll. luafuzzy.dll is now compatible with IgnacioCastano Lua binary)
A Lua 5.0-beta compatible version of the c source  and a Win32 mingw-msys Makefile  are available for download. Place the files in lua-5.0-beta/mods/fuzzy for the Makefile to work. You may also need the config file .