为Mac的自带的词典添加自定义词库


1.准备词库mdx、css文件

2.安装Dictionary Development Kit

https://github.com/SebastianSzturo/Dictionary-Development-Kit

安装后目录结构如下:

/Applications/Utilities/Dictionary\ Development\ Kit
├── README.md
├── bin
├── documents
├── project_templates
└── samples

3.下载pyglossary

https://github.com/ilius/pyglossary

4. 安装词典

cd $pyglossary-path
python3 $pyglossary-path/main.py --write-format=AppleDict dict.mdx $directory-name
cd $directory-name

复制词典原来附随的css样式,粘贴到$directory-name下的css文件中.
.plist文件第10行更改的CFBundleDisplayName值,这将会是是词库在词典显示的名字

make && make install

词典将会安装到~/Library/Dictionaries目录

5.最后

重启词典应用,在词典的偏好设置里添加自定义词典


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM