Simple utility to turn swipes into words -- "plugin" for wvkbd to enable swipe-typing under wayland SXMO.
Diffstat (limited to 'mapScore.c')
-rw-r--r--mapScore.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mapScore.c b/mapScore.c
index f003bc9..1135c2b 100644
--- a/mapScore.c
+++ b/mapScore.c
@@ -20,7 +20,7 @@ void makeMap(FILE *f) {
map[c][1] = y;
map[c][2] = 1;
c = toupper(c);
- if (map[toupper(c)][2] == 0) goto explicit_label;
+ if (c < 256 && map[c][2] == 0) goto explicit_label;
break;
}
}
@@ -33,8 +33,8 @@ int scoreWord(char *word, int (*fun)(int*,int*)) {
for (c++;*c;c++) {
if (*c == '\n') break;
// pass over ignore unset chars.
- if(map[(unsigned)*c][3] == 0) continue;
- score += (*fun)(map[(unsigned)*p],map[(unsigned)*c]);
+ if(map[(unsigned char)*c][3] == 0) continue;
+ score += (*fun)(map[(unsigned char)*p],map[(unsigned char)*c]);
p=c;
}
return score;
@@ -62,7 +62,7 @@ int beeDist(int *p1, int *p2) {
int main(int argc, char **argv) {
if (argc < 2) {
- fprintf(stderr, "Usage: mapScore map.tsv <words.txt >scoredWords.tsv");
+ fprintf(stderr, "Usage: mapScore map.tsv <words.txt >scoredWords.tsv\n");
return 1;
}