1
0

The dumb crashes continue

This commit is contained in:
Jon Michael Aanes 2018-07-21 14:35:06 +02:00
parent cdb1d90140
commit 60e525a367

View File

@ -188,7 +188,7 @@ local function strings_with_highest_similarity (str, list_of_other_str)
local total_sim = 0 local total_sim = 0
for _, similarity_func in ipairs(SIMILARITY_METRICS) do for _, similarity_func in ipairs(SIMILARITY_METRICS) do
local sim, max_sim, min_sim = similarity_func(str, other_str) local sim, max_sim, min_sim = similarity_func(str, other_str)
assert(min_sim <= max_sim) --assert(min_sim <= max_sim)
total_sim = total_sim + (sim-min_sim)/(max_sim-min_sim) total_sim = total_sim + (sim-min_sim)/(max_sim-min_sim)
end end
possible[#possible+1] = {other_str, total_sim} possible[#possible+1] = {other_str, total_sim}