From 9294725b11e8a0c35c630749cc52b108b76857ec Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Sun, 5 Jun 2016 20:48:01 -0400 Subject: Added Fuzzy sorting functions --- FuzzelExample.lua | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 FuzzelExample.lua (limited to 'FuzzelExample.lua') diff --git a/FuzzelExample.lua b/FuzzelExample.lua deleted file mode 100644 index 5bf62cf..0000000 --- a/FuzzelExample.lua +++ /dev/null @@ -1,23 +0,0 @@ ---Include the module -local fuzzel = dofile("fuzzel.lua") - ---A function that takes a table and returns a function that takes a string, and returns the closesting match in the table. -function suggestoption(tbl_options) - return function(str) - local closest = fuzzel.FuzzySearchDistance(str,tbl_options) - return closest - end -end - ---A couple of options -local options = { - "Fat Cat", - "Lazy Dog", - "Brown Fox", -} - ---Create the function, with our options -local suggestfunc = suggestoption(options) - ---And use it, to see what option closest matches "Brown Cat" -print(suggestfunc("Brown Cat")) -- cgit v1.2.3-70-g09d2