如何从给定的 hunspell 字典中获取所有可能的单词?

Mon*_*RPG 6 c# spell-checking hunspell nhunspell

我想解析支持 hunspell 格式affdic文件的开放式办公室。

英文affdic文件可以从这里下载,例如:http : //extensions.openoffice.org/en/project/english-dictionaries-apache-openoffice

我想扫描给定.dic文件的每一行并使用提供的每行生成每个可能的单词.aff文件

我怎样才能做到这一点?

我已经安装了 NHunspell 框架,但它没有该功能:https ://www.nuget.org/packages/NHunspell/

例如对于英语让我们考虑

make/UAGS
Run Code Online (Sandbox Code Playgroud)

制作可以是make, made, makes, making

现在我需要解析器给我所有这些组合。我怎样才能获得它们?非常喜欢

所以基本上我想扫描字典的每一行并从该行的单词中生成所有可能的单词,我不知道我该怎么做

我也可以编写自己的解析器,但在我看来规则非常复杂,并且没有关于此的详细和简单的文档

这里我想要的基本上。图片解释的很清楚

给予analyze/ADSGen.dicen.aff归档并获得以下所有单词

analyze, analyzes, analyzing, analyzed, reanalyze, reanalyzes, reanalyzing, reanalyzed
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明

Kar*_*bak 8

如果您想要整个数据库,您可以执行unmunch

unmunch dictionary.dic dictionary.aff
Run Code Online (Sandbox Code Playgroud)

请注意,hunspell 中 unmunch 的当前实现对最大单词数、affs 和生成单词的长度有限制。因此,如果目标语言超出了 unmunch 的限制,unmunch 可能会失败。

如果您只想要可以从条目生成的可能单词的列表,您可以使用wordforms

wordforms dictionary.aff dictionary.dic word
Run Code Online (Sandbox Code Playgroud)