diff options
| author | Alexander Pickering <alexandermpickering@gmail.com> | 2016-06-06 15:23:45 -0400 |
|---|---|---|
| committer | Alexander Pickering <alexandermpickering@gmail.com> | 2016-06-06 15:23:45 -0400 |
| commit | 2a4875c20a8683d92a28ddcc33e67314ce1a2ecc (patch) | |
| tree | 82d8207accff17394ddbb603006e3122faf8b2cd /fuzzel.lua | |
| parent | f9f102045096143998e75294dc3d409fc807819e (diff) | |
| download | fuzzel-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.lua | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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 |
