macos扩展词典+Alfred

mac工具Alfred:https://github.com/ilius/pyglossary
词典转换库pyglossary:https://github.com/ilius/pyglossary
stardict下载:http://download.huzheng.org/zh_CN/(下载过来的格式是tar.bz2)
Additional Tool For Xcode:https://developer.apple.com/download/more/

1.解压词典,得到3个文件:

  • *.ifo:词典主文件,用来转换
  • *.idx
  • *.dict.dz

2.根据提示安装需要的环境

3.解析词典:

cd [词典.ifo文件目录]
python3 [pyglossary目录]/pyglossary/main.py --write-format=AppleDict [词典文件].ifo [转换后的词典名字]
//开始解析词典
//成功会输出Writing file "[词典转换后的名字]" done.

4.下载对应的Additional Tool

5.拷贝Uitlities目录下的Dictionary Development Kit到某一目录

6.修改makefile:

#DICT_BUILD_TOOL_DIR    =   "/Applications/Utilities/DictionaryDevelopmentKit/Dictionary Development Kit"
DICT_BUILD_TOOL_DIR =   /Dictionary Development Kit路径"

7.执行make

cd [词典转换后的名字]
make && make install

8.打开词典app偏好设置看到新增加的词典

你可能感兴趣的:(macos扩展词典+Alfred)