diff options
author | Joey Hess <joey@kitenet.net> | 2012-04-14 16:01:08 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-04-14 16:01:08 -0400 |
commit | 70538dac844f00ccbdd0f2d0283fbf4e707cb84a (patch) | |
tree | edabc638949509b2a2be2fac163f2d6500fd50ee /Git | |
parent | 61e5663097a2cf779d136b5a28500460293e9e3c (diff) |
compute distance in correct direction
Diffstat (limited to 'Git')
-rw-r--r-- | Git/AutoCorrect.hs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Git/AutoCorrect.hs b/Git/AutoCorrect.hs index a18bf5619..a1ef14779 100644 --- a/Git/AutoCorrect.hs +++ b/Git/AutoCorrect.hs @@ -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 |