From 70538dac844f00ccbdd0f2d0283fbf4e707cb84a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 14 Apr 2012 16:01:08 -0400 Subject: compute distance in correct direction --- Git/AutoCorrect.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- cgit v1.2.3