| 1 |
#!/bin/sh |
| 2 |
# |
| 3 |
# Check that known typos are not found in dictionary |
| 4 |
# |
| 5 |
# (c) 2019-2023 Roland Rosenfeld <[email protected]> |
| 6 |
|
| 7 |
# case sensitive: |
| 8 |
TYPOS="Aour seperation Gie0erei Behalter äußester changable Pirmarschule Stehgreif Verländerungsschnüre vornehemn Mannschaftskolleging iBuchen" |
| 9 |
|
| 10 |
# case insensitive: |
| 11 |
TYPOSi="managment" |
| 12 |
|
| 13 |
# Dictionary to test: |
| 14 |
DICT=/usr/share/trans/de-en |
| 15 |
|
| 16 |
FOUND="" |
| 17 |
|
| 18 |
for i in $TYPOS "none tumor" |
| 19 |
do |
| 20 |
if grep -q "$i" "$DICT" |
| 21 |
then |
| 22 |
FOUND="$i $FOUND" |
| 23 |
fi |
| 24 |
done |
| 25 |
|
| 26 |
for i in $TYPOSi |
| 27 |
do |
| 28 |
if grep -qi "$i" "$DICT" |
| 29 |
then |
| 30 |
FOUND="$i $FOUND" |
| 31 |
fi |
| 32 |
done |
| 33 |
|
| 34 |
if [ -z "$FOUND" ] |
| 35 |
then |
| 36 |
exit 0 |
| 37 |
else |
| 38 |
echo "Found following typos in $DICT:" |
| 39 |
echo "$FOUND" |
| 40 |
exit 1 |
| 41 |
fi |