File: typos

package info (click to toggle)
ding 1.9-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 82,052 kB
  • sloc: tcl: 27,388; sh: 273; perl: 122; makefile: 48; xml: 28
file content (41 lines) | stat: -rwxr-xr-x 695 bytes parent folder | download | duplicates (2)
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
#!/bin/sh
#
# Check that known typos are not found in dictionary
#
# (c) 2019-2023 Roland Rosenfeld <roland@debian.org>

# case sensitive:
TYPOS="Aour seperation Gie0erei Behalter äußester changable Pirmarschule Stehgreif Verländerungsschnüre vornehemn Mannschaftskolleging iBuchen"

# case insensitive:
TYPOSi="managment"

# Dictionary to test:
DICT=/usr/share/trans/de-en

FOUND=""

for i in $TYPOS "none tumor"
do
    if grep -q "$i" "$DICT"
    then
	FOUND="$i $FOUND"
    fi
done

for i in $TYPOSi
do
    if grep -qi "$i" "$DICT"
    then
	FOUND="$i $FOUND"
    fi
done

if [ -z "$FOUND" ]
then
    exit 0
else
    echo "Found following typos in $DICT:"
    echo "$FOUND"
    exit 1
fi