diff options
| author | Zach DeCook <zachdecook@librem.one> | 2022-01-24 20:42:58 -0500 |
|---|---|---|
| committer | Zach DeCook <zachdecook@librem.one> | 2022-01-24 21:05:33 -0500 |
| commit | 42347937a7d554cc4ffad0851d2a2fc0452f93dc (patch) | |
| tree | 2701388688f0d2a2e37233d2382b2448312b74ea /swipeGuess.sh | |
| parent | a8cb10f119b8f3244d003c6733cdd16c2079ab55 (diff) | |
| download | swipeGuess-0.2.0.tar.gz | |
Readme: Update for c rewrite v0.2.0
Remove old shell version because it's slow.
Diffstat (limited to 'swipeGuess.sh')
| -rwxr-xr-x | swipeGuess.sh | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/swipeGuess.sh b/swipeGuess.sh deleted file mode 100755 index 71e811d..0000000 --- a/swipeGuess.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -source "$(dirname "$0")/functions.sh" - -swipeToQuery(){ - swipe=$(echo "$1" | tr -d ".\*\"\\^$\(\)") - printf '^' - printf '%s\\+%s' "${swipe:0:1}" "${swipe:1:1}" - if test "${swipe:2}"; then - printf "${swipe:2}" |grep -o . | xargs -I{} printf '*%s' "{}" - fi - printf '\+$' -} - -query(){ - swipe="$2" - wordlist="$1" - wordfile="$wordlist" - if test -d "$wordlist"; then - wordfile=/dev/null - fl=$(firstLetter "$swipe") - ll=$(lastLetter "$swipe") - test -f "$wordlist/$fl$ll" && wordfile="$wordlist/$fl$ll" - fi - - query=$(swipeToQuery "$swipe") - echo "query: $query" > /dev/stderr - # -m 1: just give first result - grep -i -m 1 "$query" "$wordfile" -} - -while read -r line; do - test "$line" && query "$1" "$line" && printf '\n' -done |
