在Windows上进行aspell字典制作:无法打开iso-8859-1.cset以供阅读。

3
我已经在Windows上使用mingw64和msys编译了aspell,以便与enchant和pyenchant一起使用,但我仍然没有任何字典可用:"aspell dump dicts"没有返回任何结果。
现在我正在尝试从http://gnu.c3sl.ufpr.br/ftp/aspell/dict/en/获取一个en词典,并执行./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; Aspell 0.60
有人能帮帮我吗?
谢谢。
1个回答

0

这可能与你如何编译 aspell 有关。

我已经成功地在 Windows 7 x64 的 MSYS 环境下使用 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

所以我按照这个指南这里(我猜你也是这么做的)来绕过这个错误。

所有的编译都完成了,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工作的问题。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接