]> git.donarmstrong.com Git - deb_pkgs/scowl.git/blob - 7.1/speller/make-hunspell-dict
[svn-upgrade] Tagging scowl (7.1)
[deb_pkgs/scowl.git] / 7.1 / speller / make-hunspell-dict
1 #!/bin/bash
2
3 ASPELL=aspell
4 HUNSPELL=hunspell
5
6 set -e
7
8 export LANG=C
9 export LC_ALL=C
10 export LC_CTYPE=C
11 export LC_COLLATE=C
12
13 prep() {
14   echo prep 
15
16   cat misc/{offensive.1,offensive.2,profane.1} | sort -u > nosug
17
18   cp en.aff eng_affix.dat
19
20   cat << EOF > eng.dat
21 name eng
22 charset iso8859-1
23 special ' -*-
24 affix eng
25 EOF
26 }
27
28 doit() {
29   echo creating en_$1.dic
30
31   cat en-common.wl en_$1-wo_accents-only.wl | sort -u > en_$1.0
32
33   comm en_$1.0 nosug -12 > en_$1-nosug.1
34
35   comm en_$1.0 nosug -23 > en_$1.1
36
37   $ASPELL -l ./eng munch-list < en_$1-nosug.1 | grep -v '^\(XXX\|>>>\)' | ./add-no-suggest > en_$1.2
38
39   $ASPELL -l ./eng munch-list < en_$1.1 | grep -v '^\(XXX\|>>>\)' >> en_$1.2
40
41   cat en.dic.supp >> en_$1.2
42
43   wc -l en_$1.2 | cut -d' ' -f1 > en_$1.dic
44   cat en_$1.2 | sort >> en_$1.dic
45
46   cp en.aff en_$1.aff
47   
48   cat README_en.txt.in ../Copyright > README_en_$1.txt
49   echo >> README_en_$1.txt
50   echo "Build Date: `date`" >> README_en_$1.txt
51
52   zip -9 en_$1.zip README_en_$1.txt en_$1.dic en_$1.aff
53
54   cp -p en_$1.zip hunspell/
55
56   #echo check
57
58   cat en_$1-nosug.1 en_$1.1 | sort -u > en_$1.tocheck
59
60   #hunspell -l -d ./en_$1 < en_$1.dic.tocheck > misspelled
61 }
62
63
64 prep
65
66 doit US
67 doit CA
68
69 rm eng*.dat nosug en_US*.? en_CA*.?