compute distance in correct direction
This commit is contained in:
parent
61e5663097
commit
70538dac84
1 changed files with 1 additions and 1 deletions
|
@ -34,7 +34,7 @@ fuzzymatches :: String -> (c -> String) -> [c] -> [c]
|
|||
fuzzymatches input showchoice choices = fst $ unzip $
|
||||
sortBy comparecost $ filter similarEnough $ zip choices costs
|
||||
where
|
||||
distance v = restrictedDamerauLevenshteinDistance gitEditCosts v input
|
||||
distance = restrictedDamerauLevenshteinDistance gitEditCosts input
|
||||
costs = map (distance . showchoice) choices
|
||||
comparecost a b = compare (snd a) (snd b)
|
||||
similarEnough (_, cst) = cst < similarityFloor
|
||||
|
|
Loading…
Reference in a new issue