如何转换带有词缀文件 (.aff) 的字典文件 (.dic) 以创建单词列表?

wor*_*ess 5 dictionary

我正在查看字典文件(“.dic”)及其关联的“aff”文件。我想要做的是将“aff”文件中的规则与“dic”文件中的单词结合起来,以创建包含在字典文件中的所有单词的全局列表。

这些文件背后的文档很难找到。有谁知道我可以学习的资源?

是否有任何代码已经可以做到这一点(我是否在重复不需要的工作)?

谢谢!

Rub*_*les 5

根据Pillowcase,这是一个用法示例:

# Download dictionary
wget -O ./dic/es_ES.aff "https://raw.githubusercontent.com/sbosio/rla-es/master/source-code/hispalabras-0.1/hispalabras/es_ES.aff"
wget -O ./dic/es_ES.dic "https://raw.githubusercontent.com/sbosio/rla-es/master/source-code/hispalabras-0.1/hispalabras/es_ES.dic"

# Compile program
wget -O ./dic/unmunch.cxx "https://raw.githubusercontent.com/hunspell/hunspell/master/src/tools/unmunch.cxx"
wget -O ./dic/unmunch.h "https://raw.githubusercontent.com/hunspell/hunspell/master/src/tools/unmunch.h"
g++ -o ./dic/unmunch ./dic/unmunch.cxx

# Generate dictionary
./dic/unmunch ./dic/es_ES.dic ./dic/es_ES.aff 2> /dev/null > ./dic/es_ES.txt.bk
sort ./dic/es_ES.txt.bk > ./dic/es_ES.txt # Opcional
rm ./dic/es_ES.txt.bk # Opcional
Run Code Online (Sandbox Code Playgroud)


Mod*_*ode 2

您需要一个名为 munch.exe 的实用程序来将 aff 规则应用于 dic 文件。