Hunspell - 无法打开名为 en_US 的词典的词缀或词典文件

发布于 2024-12-27 19:31:49 字数 184 浏览 4 评论 0原文

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

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

如何解决此问题?我在 Mac 上。

谢谢,凯文

I'd like to use hunspell to spell check my repo. However when I try to run it I get the following error:

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

How can I fix this? I'm on a Mac.

Thanks, Kevin

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

花想c 2025-01-03 19:31:49

执行 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

Execute hunspell -D. You should get output like this:

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

This lists the directories in which hunspell is searching for dictionary files, as well as the dictionaries is has found. If the dictionary en_US isn't listed, you haven't got that particular dictionary installed.

To install a dictionary, search for it in the LibreOffice extension repository. Download it then extract the .aff and .dic files to one of the locations listed by hunspell -D. For example:

# 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
花开浅夏 2025-01-03 19:31:49

我在 Windows 中使用 emacs,使用 msys2。我安装了以下 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 它对我不起作用。

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

    搜索路径:
    .;... ;...;...
    可用字典(-d 选项的路径不是必需的):
    D:/xx/mysys64/mingw64/share/hunspell/en_AG
    D:/xx/mysys64/mingw64/share/hunspell/en_AU
    ...
    

    Hunspell 1.6.0

I'm using emacs in windows using msys2. I installed following 2 packages:

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

The mingw-w64-x86_64-hunspell-en package install english dictionaries in /mingw64/share/hunspell, but you check if the files (en_US.dic and en_US.aff) are available or not.

Steps:

  1. set the Environment Variable in .bashrc within mysys2. Without DICPATH it was not working for me.

    export DICTIONARY=en_US
    export DICPATH=/d/../msys2/ming164/share/hunspell
    
  2. run 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
    ...
    

    Hunspell 1.6.0

梦萦几度 2025-01-03 19:31:49

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

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

I was lucky to find my language here: https://extensions.openoffice.org/en/search?query=de_CH&sort_by=field_project_stats_year&sort_order=DESC

And with the comment from @RobDavenport i was able to rename the extension and extract the files. Something i reread at this link and gave it a try.
I dropped the .dic .dat and .aff into my ~/Library/Spelling/ folder.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文