X-Git-Url: https://git.donarmstrong.com/?p=deb_pkgs%2Fscowl.git;a=blobdiff_plain;f=6%2Fsrc%2Fmake-words;fp=6%2Fsrc%2Fmake-words;h=fe3cfb76925744307ea36c63f13bbd39ddfdf2c1;hp=0000000000000000000000000000000000000000;hb=d5cbd5b855d8157fe44cd0979c2e517b93fb5004;hpb=0ba1587a200ebb44aea6355ee9330a720e3ecde2 diff --git a/6/src/make-words b/6/src/make-words new file mode 100755 index 0000000..fe3cfb7 --- /dev/null +++ b/6/src/make-words @@ -0,0 +1,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 + +