]> git.donarmstrong.com Git - deb_pkgs/scowl.git/blob - src/make-words
upgrade to scowl 7.1
[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   supplement=`src/get-all-below $1 supplement`  
13   add_affixes="`src/get-all-below $1 add-affixes`"
14   add_possessive="`src/get-all-below $1 add-possessive`"
15
16   cat $supplement $add_affixes $add_possessive l/include/$1/* \
17     | src/filter                                              \
18     > working/words.$1.tmp
19   cp working/words.$1.tmp working/words.$1.tmp.0
20
21   if [ -n "$add_affixes" ] && [ $1 -le `cat l/add-affixes/max-level` ]
22   then
23     echo "Adding affixes"
24     cat $add_affixes | src/filter | src/add-affixes >> working/words.$1.tmp
25     cp working/words.$1.tmp working/words.$1.tmp.1
26   fi
27
28   if [ $1 -lt 80 ]
29   then
30     if [ -n "$add_possessive" ]
31     then
32       echo "Adding possessive"
33       cat $add_possessive | src/filter | src/add-affixes just-possessive >> working/words.$1.tmp
34       cp working/words.$1.tmp working/words.$1.tmp.2
35     fi
36   else
37     echo "Adding possessive"
38     cat working/words.$1.tmp                       \
39       | src/add-affixes use-some just-possessive   \
40       > working/words.$1.tmp2
41     mv working/words.$1.tmp2 working/words.$1.tmp
42   fi
43
44   cat working/words.$1.tmp    \
45     | src/add-other-spellings \
46     | src/add-other-forms     \
47     | src/add-other-spellings \
48     | sort -u                 \
49     | comm -12  - working/words.`src/get-level next $1` \
50     > working/words.$1
51
52   #rm working/words.$1.tmp
53
54 else
55
56   cat working/all.lst           \
57     | src/add-affixes use-all just-possessive \
58     | src/add-other-spellings   \
59     | sort -u                   \
60     > working/words.$1
61
62 fi