3

我已经在 Windows 上用 mingw64 和 msys 编译了 aspell 以与 enchant 和 pyenchant 一起使用,但我仍然没有任何 dicts:“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

有谁能够帮我?

谢谢。

4

1 回答 1

0

它可能与您如何编译 aspell 有关。

我已经在 MSYS 环境下的 Windows 7 x64 和 gcc 4.7.0 下成功编译并运行 aspell 0.60.61 和字典 aspell6-en-7.1-0 (确切地说是mingw32-4.7.0-posix-dwarf-rev0)。我还没有解决它的所有问题,但这是我的发现:

我使用的配置是:

$ ./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

所以我在这里按照本指南(我猜你可能也这样做了)来绕过这个错误。

一切编译和 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 并发现我跳过的代码与路径处理有关。后来我发现这篇日文文章指出 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 工作的文章/网页

于 2014-12-21T15:55:10.243 回答