|
本帖最后由 dgww 于 2016-12-28 11:22 编辑
转换目标:7w詞條!微軟必應雙向簡明詞典 https://www.pdawiki.com/forum/thread-16448-1-1.html
转换工具:
https://github.com/ilius/pyglossary
https://github.com/SebastianSzturo/Dictionary-Development-Kit
转换命令:
- python3 pyglossary.pyw ~/Downloads/MBD/Microsoft\ Bing\ Dictionary.mdx ~/Desktop/Microsoft.bing.xml --read-format=OctopusMdict --write-format=AppleDict
复制代码
制作苹果字典:
把生成的Microsoft.bing/Microsoft.bing.xml 文件复制到Dictionary-Development-Kit目录,并修改对应的Makefile
- DICT_NAME = "微軟必應雙向簡明詞典"
- DICT_SRC_PATH = MyDictionary.xml
- CSS_PATH = MyDictionary.css
- PLIST_PATH = MyInfo.plist
复制代码
修改MyInfo.plist
- <key>CFBundleIdentifier</key>
- <string>com.apple.dictionary.microsoft.bing70000</string>
- <key>CFBundleName</key>
- <string>微軟必應雙向簡明詞典</string>
- <key>CFBundleShortVersionString</key>
复制代码
复制Mdict自带的css文件内容到MyDictionary.css,然后执行:
- [~/Dictionary-Development-Kit/project_templates]$ make && make install
- """/Users/usr/Dictionary-Development-Kit"/bin"/build_dict.sh" "微軟必應雙向簡明詞典" MyDictionary.xml MyDictionary.css MyInfo.plist
- - Building 微軟必應雙向簡明詞典.dictionary.
- - Cleaning objects directory.
- - Preparing dictionary template.
- - Preprocessing dictionary sources.
- - Extracting index data.
- - Preparing dictionary bundle.
- - Adding body data.
- - Preparing index data.
- - Building key_text index.
- - Building reference index.
- * Note: No reference index record.
- - Fixing dictionary property.
- - Copying CSS.
- - Copying other resources.
- - Finished building ./objects/微軟必應雙向簡明詞典.dictionary.
- echo "Done."
- Done.
- echo "Installing into ~/Library/Dictionaries".
- Installing into ~/Library/Dictionaries.
- mkdir -p ~/Library/Dictionaries
- ditto --noextattr --norsrc ./objects/"微軟必應雙向簡明詞典".dictionary ~/Library/Dictionaries/"微軟必應雙向簡明詞典".dictionary
- touch ~/Library/Dictionaries
- echo "Done."
- Done.
- echo "To test the new dictionary, try Dictionary.app."
复制代码
转换结果:
|
评分
-
1
查看全部评分
-
|