我已经在 Windows 上使用 mingw64 和 msys 编译了 aspell 以与 enchant 和 pyenchant 一起使用,但我仍然没有任何指令:“aspell dump dicts”不返回任何内容。
我现在正在尝试的是使用从 http://gnu.c3sl.ufpr.br/ftp/aspell/dict/en/ 获得的 en dict 执行 ./configure、make 和 make install .
.configure 执行成功,但 make 返回:
/mingw/bin/prezip-bin.exe -d < en-common.cwl | /mingw/bin/aspell.exe --lang=en create master ./en-common.rws
Error: The file "/mingw/lib/aspell-0.60/iso-8859-1.cset" can not be opened for reading.
Makefile:108: recipe for target `en-common.rws' failed
make: *** [en-common.rws] Error 1
我已经检查了这个文件 (iso-8859-1.cset) 的权限,停用了防病毒软件,以管理权限执行了 msys,但没有解决问题。 该文件可在任何文本编辑器中正确打开。
这个任务我的系统配置是: Windows 8.1 x64; Mingw-64 + MSYS; 拼写 0.60
谁能帮帮我?
谢谢。
最佳答案
这可能与您编译 aspell 的方式有关。
我已经在 MSYS 环境下的 Windows 7 x64 和 gcc 4.7.0(准确地说是 mingw32-4.7.0-posix-dwarf-rev0)下成功编译并运行了 aspell 0.60.61 和字典 aspell6-en-7.1-0 ).我还没有解决所有问题,但这是我的发现:
我使用的配置是:
$ ./configure --disable-shared --enable-static --enable-win32-relocatable
当我第一次编译 aspell 时出现编译错误:
common/file_util.cpp: In function 'bool acommon::need_dir(acommon::ParmString)':
common/file_util.cpp:49:32: error: 'asc_isalpha' was not declared in this scope
所以我遵循了本指南 here (我猜你可能也做过)来绕过这个错误。
所有编译的和aspell都可以运行,但是它一直给我解决错误的路径,包括你得到的错误,或者类似的东西
Error: The file "/usr/local/lib/aspell-0.60//usr/loc`enter code here`al/lib/aspell-0.60/en_US.multi" can not be opened for reading.
(我没有保留原始消息,但它是这样的) 我什至尝试使用 --data-dir、--dict-dir 或 --local-data-dir 选项,但我唯一让它起作用的时候是在/usr/local/lib/aspell-0.60 中/文件夹并将 --data-dir 设置为 ./
但不应该是这样的,所以我回头查看file_util.cpp,发现我跳过的代码与路径处理有关。后来我发现了这个 Japanese article指出 asc_isalpha 是在 asc_tyoe.hpp 中定义的。所以我添加
#include "asc_ctype.hpp"
到file_util.cpp,重新编译aspell。然后尝试编译aspell6-en-7.1-0,这次没有报错,字典编译成功。
现在的问题是 aspell 默认情况下仍然无法找到字典,它仍然会给出如下错误信息:
Error: No word lists can be found for the language "en_US".
即使 aspell 默认有正确的数据目录:
$ aspell config data-dir
/usr/local/lib/aspell-0.60
但至少 --data-dir 选项现在有效,所以我可以像这样使用 aspell:
$ aspell --data-dir=/usr/local/lib/aspell-0.60/ -c test.txt
希望你也能解决你的aspell问题。
引用:
http://lists.gnu.org/archive/html/aspell-user/2007-10/msg00008.html
http://mikanya.dip.jp/memo/2007-09-07-1
https://www.mail-archive.com/aspell-user%40gnu.org/msg02226.html
http://osdir.com/ml/general/2014-12/msg10031.html
非常感谢这些帮助我弄清楚如何使 aspell 工作的文章/网页
关于python - aspell dict make on windows : iso-8859-1. cset 无法打开阅读,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21446620/