Index: graphspell/char_player.py ================================================================== --- graphspell/char_player.py +++ graphspell/char_player.py @@ -1,12 +1,10 @@ """ List of similar chars useful for suggestion mechanism """ -import re - dDistanceBetweenChars = { "a": {}, "e": {"é": 0.5}, "é": {"e": 0.5}, @@ -36,10 +34,11 @@ "z": {"s": 0.5} } def distanceBetweenChars (c1, c2): + "returns a float between 0 and 1" if c1 == c2: return 0 if c1 not in dDistanceBetweenChars: return 1 return dDistanceBetweenChars[c1].get(c2, 1)