]> git.donarmstrong.com Git - deb_pkgs/scowl.git/blob - src/make-words
[svn-inject] Installing original source of scowl
[deb_pkgs/scowl.git] / src / make-words
1 #!/bin/bash
2
3 rm -f words.$1*
4
5 shopt -s nullglob
6
7 max_level=`src/get-level max`
8
9 if [ $1 -ne $max_level ]
10 then
11
12   add_affixes="`src/get-all-below $1 add-affixes`"
13
14   cat `src/get-all-below $1 supplement` $add_affixes l/include/$1/* \
15     | src/filter | sort | uniq > working/words.$1.tmp
16
17   if [ -n "$add_affixes" ] && [ $1 -le `cat l/add-affixes/max-level` ]
18   then
19     echo "Adding affixes"
20     cat $add_affixes | src/add-affixes >> working/words.$1.tmp
21   fi
22
23   src/add-possessive working/words.$1.tmp
24
25   cat working/words.$1.tmp    \
26     | src/filter              \
27     | src/add-other-spellings \
28     | src/add-other-forms     \
29     | src/add-other-spellings \
30     | sort -u                 \
31     | comm -12  - working/words.`src/get-level next $1` \
32     > working/words.$1
33
34   rm working/words.$1.tmp
35
36 else
37
38   cat working/all.lst           \
39     | src/add-possessive        \
40     | src/add-other-spellings   \
41     | sort -u                   \
42     > working/words.$1
43
44 fi
45
46