about summary refs log tree commit diff
diff options
context:
space:
mode:
authorZach DeCook <zachdecook@librem.one>2022-01-28 09:05:42 -0500
committerZach DeCook <zachdecook@librem.one>2022-01-28 09:05:42 -0500
commitd31a7482c3e05b87a18a23e55fb04a8c65e98ee5 (patch)
tree0c12b57b5d77e88f4dc644bdc2d20ca64a0ce2f4
parent65603837e593b5f67c74528e04b6afb7a1b77861 (diff)
downloadSwipeBehaviors-d31a7482c3e05b87a18a23e55fb04a8c65e98ee5.tar.gz
swipeBehaviors: cull unlikely choices with keyboard map
-rwxr-xr-xswipeGuessPicker.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/swipeGuessPicker.sh b/swipeGuessPicker.sh
index 6e233c0..69dda6e 100755
--- a/swipeGuessPicker.sh
+++ b/swipeGuessPicker.sh
@@ -7,12 +7,17 @@ mkfifo "$sock"
 cat 0<> "$sock"|suggpicker 2>/dev/null|completelyTypeWord.sh &
 swipeGuess "$words" 5 | while read -r word; do
 	set -- $word
-	if test "$2"; then
+	if test -n "$2"; then
 		s1="$(echo "$1" | mapScore "$keymap" bee|cut -f1)"
 		s2="$(echo "$2" | mapScore "$keymap" bee |cut -f1)"
-		cutoff="$(( ($s1 * 9 / 10) - 3 ))"
+		cutoff="$(( ($s1 * 19 / 20) - 2 ))"
 		if [ "$s2" -lt "$cutoff" ]; then
 			set -- "$1"
+		elif [ -n "$4" ]; then
+			s4="$(echo "$4" | mapScore "$keymap" bee |cut -f1)"
+			if [ "$s4" -lt "$cutoff" ]; then
+				set -- "$1" "$2" "$3"
+			fi
 		fi
 	fi
 	if test "$1" && ! test "$2"; then