31

我想使用 hunspell 拼写检查我的回购。但是,当我尝试运行它时,出现以下错误:

Can't open affix or dictionary files for dictionary named "en_US".

我怎样才能解决这个问题?我在 Mac 上。

谢谢,凯文

4

3 回答 3

36

执行hunspell -D。你应该得到这样的输出:

.::/usr/share/hunspell:/usr/share/myspell:
/usr/share/myspell/dicts:/Library/Spelling:

AVAILABLE DICTIONARIES (path is not mandatory for -d option):
/Library/Spelling/en_GB
LOADED DICTIONARY:
/Library/Spelling/en_GB.aff
/Library/Spelling/en_GB.dic

这列出了正在其中hunspell搜索字典文件的目录,以及已找到的字典。如果en_US未列出该词典,则说明您没有安装该特定词典。

要安装字典,请在LibreOffice 扩展存储库中搜索它。.aff下载它,然后将和文件解压缩.dic到 列出的位置之一hunspell -D。例如:

# First download dict-en.oxt
unzip dict-en.oxt -d dict-en
cp dict-en/en_GB.aff dict-en/en_GB.dic ~/Library/Spelling/
rm -r dict-en
于 2012-02-24T18:41:56.693 回答
2

我在使用 msys2 的 windows 中使用 emacs。我安装了以下 2 个软件包:

pacman -S  mingw-w64-x86_64-hunspell-en mingw-w64-x86_64-hunspell

mingw-w64-x86_64-hunspell-en 软件包在 /mingw64/share/hunspell 中安装英文词典,但您检查文件(en_US.dic 和 en_US.aff)是否可用。

脚步:

  1. 在 mysys2 中的 .bashrc 中设置环境变量。没有 DICPATH 它对我不起作用。

    export DICTIONARY=en_US
    export DICPATH=/d/../msys2/ming164/share/hunspell
    
  2. 运行 hunspell.exe -D

    SEARCH PATH:
    .;... ;...;...
    AVAILABLE DICTIONARIES (path is not mandatory for -d option):
    D:/xx/mysys64/mingw64/share/hunspell/en_AG
    D:/xx/mysys64/mingw64/share/hunspell/en_AU
    ...
    

    汉斯佩尔 1.6.0

于 2017-01-20T14:08:21.770 回答
0

我很幸运在这里找到了我的语言:https ://extensions.openoffice.org/en/search?query=de_CH&sort_by=field_project_stats_year&sort_order=DESC

通过@RobDavenport 的评论,我能够重命名扩展名并提取文件。我在这个链接上重读了一些东西并试了一下。我将 .dic .dat 和 .aff 放到我的 ~/Library/Spelling/ 文件夹中。

于 2018-03-18T11:05:03.993 回答