Simple utility to turn swipes into words -- "plugin" for wvkbd to enable swipe-typing under wayland SXMO.
| -rwxr-xr-x | mapScore.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/mapScore.py b/mapScore.py index 61a5259..154142f 100755 --- a/mapScore.py +++ b/mapScore.py @@ -21,9 +21,10 @@ def scoreWord(word,mm): pc=word[0] or ' ' s=0 for c in word: - #manhattan dist - s+=abs(mm[ord(pc)][0]-mm[ord(c)][0]) - s+=abs(mm[ord(pc)][1]-mm[ord(c)][1]) + #manhattan dist * 10 + s+=abs(mm[ord(pc)][0]-mm[ord(c)][0])*10 + s+=abs(mm[ord(pc)][1]-mm[ord(c)][1])*10 + s+=1 # longer word bias pc=c return s |