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 $ | fuzzymatches input showchoice choices = fst $ unzip $ | ||||||
| 	sortBy comparecost $ filter similarEnough $ zip choices costs | 	sortBy comparecost $ filter similarEnough $ zip choices costs | ||||||
|         where |         where | ||||||
|                 distance v = restrictedDamerauLevenshteinDistance gitEditCosts v input |                 distance = restrictedDamerauLevenshteinDistance gitEditCosts input | ||||||
|                 costs = map (distance . showchoice) choices |                 costs = map (distance . showchoice) choices | ||||||
|                 comparecost a b = compare (snd a) (snd b) |                 comparecost a b = compare (snd a) (snd b) | ||||||
|                 similarEnough (_, cst) = cst < similarityFloor |                 similarEnough (_, cst) = cst < similarityFloor | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Joey Hess
				Joey Hess