blob: e6b9ca9c91528c4dd5223d84174cf395f3025fa0 (
plain)
1 # Description: Hunspell dictionary for English
2 # URL: http://wordlist.aspell.net/
3 # Maintainer: Tim Biermann, tbier at posteo dot de
4 # Depends on: hunspell
5
6 name=hunspell-en
7 version=2020.12.07
8 release=1
9 source=(http://downloads.sourceforge.net/wordlist/speller/$version/hunspell-en_AU-$version.zip
10 http://downloads.sourceforge.net/wordlist/speller/$version/hunspell-en_US-$version.zip
11 http://downloads.sourceforge.net/wordlist/speller/$version/hunspell-en_CA-$version.zip
12 http://downloads.sourceforge.net/wordlist/speller/$version/hunspell-en_GB-ise-$version.zip)
13
14 build() {
15 declare -A missing
16 missing[en_GB]="en_AG en_BS en_BW en_BZ en_DK en_GH en_HK en_IE en_IN en_JM en_NA en_NG en_NZ en_SG en_TT en_ZA en_ZW"
17 missing[en_US]="en_PH"
18
19 mkdir -p $PKG/usr/share/hunspell
20
21 cp $SRC/*.aff $SRC/*.dic $PKG/usr/share/hunspell/
22 mv $PKG/usr/share/hunspell/{en_GB-ise.aff,en_GB.aff}
23 mv $PKG/usr/share/hunspell/{en_GB-ise.dic,en_GB.dic}
24
25 # Replace duplicate files with symbolic links
26 pushd $PKG/usr/share/hunspell
27 (md5sum * | sort | uniq --repeated -w 32 --all-repeated=separate; echo) | \
28 while read sum name; do
29 if [ -n "$name" ]; then
30 [ -z "$dups" ] && declare -A dups
31 dups[${#dups[*]}]=$name
32 else
33 for name in ${dups[@]}; do
34 [ $name != ${dups[0]} ] && ln -s -f ${dups[0]} $name
35 done
36 unset dups
37 fi
38 done
39 popd
40
41 # Create symbolic links for missing dictionaries
42 pushd $PKG/usr/share/hunspell
43 for lang in ${!missing[@]}; do
44 for new in ${missing[$lang]}; do
45 ln -s $lang.aff $new.aff
46 ln -s $lang.dic $new.dic
47 done
48 done
49 popd
50 }
|