aboutsummaryrefslogtreecommitdiff
path: root/fuzzel.lua
diff options
context:
space:
mode:
authorAlexander Pickering <alexandermpickering@gmail.com>2016-06-06 15:23:45 -0400
committerAlexander Pickering <alexandermpickering@gmail.com>2016-06-06 15:23:45 -0400
commit2a4875c20a8683d92a28ddcc33e67314ce1a2ecc (patch)
tree82d8207accff17394ddbb603006e3122faf8b2cd /fuzzel.lua
parentf9f102045096143998e75294dc3d409fc807819e (diff)
downloadfuzzel-2a4875c20a8683d92a28ddcc33e67314ce1a2ecc.tar.gz
fuzzel-2a4875c20a8683d92a28ddcc33e67314ce1a2ecc.tar.bz2
fuzzel-2a4875c20a8683d92a28ddcc33e67314ce1a2ecc.zip
Changed example to show distance being used
Diffstat (limited to 'fuzzel.lua')
-rw-r--r--fuzzel.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/fuzzel.lua b/fuzzel.lua
index 894fd07..fc6d10d 100644
--- a/fuzzel.lua
+++ b/fuzzel.lua
@@ -68,7 +68,8 @@
}
--And use it, to see what option closest matches "Brown Cat"
- print("\"Lulzy Cat\" is close to \"" .. fuzzel.FuzzyFindDistance("Lulzy Cat",options) .. "\"")
+ local close,distance = fuzzel.FuzzyFindDistance("Lulzy Cat", options)
+ print("\"Lulzy Cat\" is close to \"" .. close .. "\", distance:" .. distance)
--Sort the options to see the order in which they most closely match "Brown Cat"
print("\"Frag God\" is closest to:")
@@ -238,7 +239,7 @@ local function FuzzySort(str, func, ...)
--Then build our output table
local otbl = {}
- for k,v in prs(sorted) do
+ for k,v in iprs(sorted) do
for i,j in prs(usorted[v]) do
tblins(otbl,j)
end