]> git.donarmstrong.com Git - deb_pkgs/scowl.git/blob - src/split-words
New upstream version 2019.10.06
[deb_pkgs/scowl.git] / src / split-words
1 #!/bin/sh
2
3 rm -f working/*.$1.pre
4
5 comm -12 working/words.$1 working/american.lst \
6   > working/american-all.$1.pre
7
8 comm -12 working/words.$1 working/british.lst \
9   > working/british-all.$1.pre
10
11 comm -12 working/words.$1 working/british_z.lst \
12   > working/british_z-all.$1.pre
13
14 comm -12 working/words.$1 working/canadian.lst \
15   > working/canadian-all.$1.pre
16
17 comm -12 working/words.$1 working/australian.lst \
18   > working/australian-all.$1.pre
19
20 comm -12 working/words.$1 working/variant_1.lst   \
21   > working/variant_1-all.$1.pre
22
23 comm -12 working/words.$1 working/variant_2.lst   \
24   > working/variant_2-all.$1.pre
25
26 comm -12 working/words.$1 working/variant_3.lst   \
27   > working/variant_3-all.$1.pre
28
29 comm -12 working/words.$1 working/british_variant_1.lst   \
30   > working/british_variant_1-all.$1.pre
31
32 comm -12 working/words.$1 working/british_variant_2.lst   \
33   > working/british_variant_2-all.$1.pre
34
35 comm -12 working/words.$1 working/canadian_variant_1.lst   \
36   > working/canadian_variant_1-all.$1.pre
37
38 comm -12 working/words.$1 working/canadian_variant_2.lst   \
39   > working/canadian_variant_2-all.$1.pre
40
41 comm -12 working/words.$1 working/australian_variant_1.lst   \
42   > working/australian_variant_1-all.$1.pre
43
44 comm -12 working/words.$1 working/australian_variant_2.lst   \
45   > working/australian_variant_2-all.$1.pre
46
47 # Hack to get australian only words in
48 if [ $1 -eq 35 ]
49 then
50   mv working/australian-all.$1.pre working/australian-all.$1.pre.pre
51   cat r/special/australian.35 | src/filter \
52     | cat - working/australian-all.$1.pre.pre | sort -u > working/australian-all.$1.pre
53 fi
54
55 cat working/*-all.$1.pre         \
56   | sort | uniq                  \
57   | comm -13 - working/words.$1  \
58   > working/english-all.$1.pre
59
60 # Hack to get australian towns in
61 if [ $1 -eq 50 ]
62 then
63   mv working/australian-all.$1.pre working/australian-all.$1.pre.pre
64   cat r/special/australian-towns | src/add-possessive \
65     | cat - r/special/australian-towns-part | src/filter \
66     | sort -u \
67     | comm -23 - working/english-all.$1.pre \
68     | cat - working/australian-all.$1.pre.pre | sort -u > working/australian-all.$1.pre
69 fi
70
71 # Hack to get U.S. Urban areas in
72 if [ $1 -eq 50 ]
73 then
74   mv working/american-all.$1.pre working/american-all.$1.pre.pre
75   cat r/special/urban-areas | src/add-possessive \
76     | src/filter \
77     | sort -u \
78     | comm -23 - working/english-all.$1.pre \
79     | cat - working/american-all.$1.pre.pre | sort -u > working/american-all.$1.pre
80 fi
81
82 for s in `src/list-spellings`
83 do
84   for c in `src/list-classes -1`
85   do
86     comm -12 working/$s-all.$1.pre working/$c.lst > working/$s-$c.$1.pre
87     cat working/$s-$c.$1.pre >> working/$s-other.$1.pre
88   done
89   sort working/$s-other.$1.pre | uniq \
90     | comm -13 - working/$s-all.$1.pre \
91     > working/$s-words.$1.pre
92   #rm working/$s-{all,other}.$1.pre
93 done
94
95
96
97
98
99