2013年9月19日木曜日

Aspellの辞書をWindowsでコンパイル

WindowsのAspellがインストールしたのに動かない!
辞書がないからということで頑張ってコンパイルしてみたら
辞書が .exe で公開されていることに後から気がついた...

でもせっかくコンパイルできたので手順を残しておく。

http://aspell.net/win32/ で Full Installer をクリックして
http://ftp.gnu.org/gnu/aspell/w32/Aspell-0-50-3-3-Setup.exe をダウンロードする。

次に English の辞書をインストールする。

コンパイル済みの辞書を利用するなら aspell-en-0.50-2-3.exe をダウンロードして実行すればインストール完了。

自前でコンパイルするなら ftp://ftp.gnu.org/gnu/aspell/dict/0index.html で
Aspell 0.50 用の English 辞書である aspell5-en-6.0-0.tar.bz2 をダウンロード。
Aspell のインストール先 (C:/Program Files (x86)/Aspell) に展開する。

Cygwin の bash でカレントディレクトリを Aspell の展開先に移動して configure を実行する。
$ ASPELL=../bin/aspell.exe PREZIP=../bin/word-list-compress.exe ./configure

できた Makefile を編集。空白を含むパスを "" で括る。

Makefile の差分:
@@ -1,9 +1,9 @@
-ASPELL = /cygdrive/c/Program Files (x86)/Aspell/bin/aspell.exe
+ASPELL = "C:/Program Files (x86)/Aspell/bin/aspell.exe"
 ASPELL_FLAGS =
-PREZIP = /cygdrive/c/Program Files (x86)/Aspell/bin/word-list-compress.exe
+PREZIP = "C:/Program Files (x86)/Aspell/bin/word-list-compress.exe"
 DESTDIR =
-dictdir = C:/Program Files (x86)/Aspell/dict
-datadir = C:/Program Files (x86)/Aspell/data
+dictdir = "C:/Program Files (x86)/Aspell/dict"
+datadir = "C:/Program Files (x86)/Aspell/data"

 # Generated with Aspell Dicts "proc" script version 0.60.2

make ; make install で辞書をインストールする。

$ make
$ make install

Aspell/dict に辞書ファイルが、Aspell/data/en.dat,en_phonet.dat に情報ファイル?? がインストールされる。

$ bin/aspell.exe dump dicts
en
en-variant_0
en-variant_1
en-variant_2
en-w_accents
en-wo_accents
en_CA
en_CA-w_accents
en_CA-wo_accents
en_GB
en_GB-ise
en_GB-ise-w_accents
en_GB-ise-wo_accents
en_GB-ize
en_GB-ize-w_accents
en_GB-ize-wo_accents
en_GB-w_accents
en_GB-wo_accents
en_US
en_US-w_accents
en_US-wo_accents