Improve scoring

This commit is contained in:
hrsh7th
2021-08-08 17:33:33 +09:00
parent 0cc4e1e145
commit efed43377b
2 changed files with 2 additions and 1 deletions

View File

@@ -135,8 +135,8 @@ matcher.match = function(input, word, words)
end
idx = idx + 1
if s > 0 then
s = s * (m.strict_match and 1.2 or 1)
score = score + (s * (1 + math.max(0, matcher.WORD_BOUNDALY_ORDER_FACTOR - (m.index - boundary_fixer)) / matcher.WORD_BOUNDALY_ORDER_FACTOR))
score = score + (m.strict_match and 0.1 or 0)
end
end