它可能与您如何编译 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 工作的文章/网页