Simple utility to turn swipes into words -- "plugin" for wvkbd to enable swipe-typing under wayland SXMO.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# swipeGuess

swipeGuess is a completion program intended to be used as a plugin for touchscreen-keyboards on mobile devices.

For each line input from stdin, it looks through a wordlist and outputs the first possible match for that gesture.

it's run like `input-program | swipeGuess.sh wordlist | output-program`

## input-program

The input program should output a stream of letters "swiped through", then a newline.

There's a WIP Merge Request towards proycon's wvkbd for an example of this.

=> https://github.com/proycon/wvkbd/pull/1

## wordlist

This should be a list of words, sorted by preferability of choice.

### sorting tips

Note: you probably want longest words first, otherewise, it may be impossible to type them.

```
# Good autocompletion for terminal
ls $PATH | awk '{ print length, $0 }' | sort -nr | cut -d" " -f2- > binsSorted.txt

```

Smarter sorting would be keyboard-layout aware. mapscore.py can do that for you

```sh
./mapScore.py map.txt <words.txt | sort -nr | cut -f2 > wordsSorted.txt
```
map.txt uses tabs and newlines to create the grid-based layout.

### alternate formats

Alternatively, for performance, you can use a directory with the following format: each file is named with the first and last letters of the contained words.
The script `makeDir.sh` is provided to help create these.

## output-program

* `completelyTypeWord.sh` (included in this repository) will type the characters (besides the first character) using wtype.