File: make-words

package info (click to toggle)
scowl 5-4
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 8,240 kB
  • ctags: 36
  • sloc: perl: 352; sh: 330; makefile: 234; cpp: 45
file content (46 lines) | stat: -rwxr-xr-x 976 bytes parent folder | download | duplicates (5)
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
42
43
44
45
46
#!/bin/bash

rm -f words.$1*

shopt -s nullglob

max_level=`src/get-level max`

if [ $1 -ne $max_level ]
then

  add_affixes="`src/get-all-below $1 add-affixes`"

  cat `src/get-all-below $1 supplement` $add_affixes l/include/$1/* \
    | src/filter | sort | uniq > working/words.$1.tmp

  if [ -n "$add_affixes" ] && [ $1 -le `cat l/add-affixes/max-level` ]
  then
    echo "Adding affixes"
    cat $add_affixes | src/add-affixes >> working/words.$1.tmp
  fi

  src/add-possessive working/words.$1.tmp

  cat working/words.$1.tmp    \
    | src/filter              \
    | src/add-other-spellings \
    | src/add-other-forms     \
    | src/add-other-spellings \
    | sort -u                 \
    | comm -12  - working/words.`src/get-level next $1` \
    > working/words.$1

  rm working/words.$1.tmp

else

  cat working/all.lst           \
    | src/add-possessive        \
    | src/add-other-spellings   \
    | sort -u                   \
    > working/words.$1

fi