diff options
| author | Alexander Pickering <alexandermpickering@gmail.com> | 2016-06-05 20:48:01 -0400 |
|---|---|---|
| committer | Alexander Pickering <alexandermpickering@gmail.com> | 2016-06-05 20:48:01 -0400 |
| commit | 9294725b11e8a0c35c630749cc52b108b76857ec (patch) | |
| tree | 654aed1950c133a8dad4f9e1f75c295e45baa199 /FuzzelExample.lua | |
| parent | 55674013e729a8ecb929bf5060e53859bd44b997 (diff) | |
| download | fuzzel-9294725b11e8a0c35c630749cc52b108b76857ec.tar.gz fuzzel-9294725b11e8a0c35c630749cc52b108b76857ec.tar.bz2 fuzzel-9294725b11e8a0c35c630749cc52b108b76857ec.zip | |
Added Fuzzy sorting functions
Diffstat (limited to 'FuzzelExample.lua')
| -rw-r--r-- | FuzzelExample.lua | 23 |
1 files changed, 0 insertions, 23 deletions
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")) |
