|
本帖最后由 dgww 于 2016-12-28 11:22 编辑 2 ~8 P1 U X' W! u
, R0 z, f8 s: m: v- X
转换目标:7w詞條!微軟必應雙向簡明詞典 https://www.pdawiki.com/forum/thread-16448-1-1.html ! t9 t: R2 Q/ i5 r
+ i5 ~4 F" W' B6 l+ U5 p转换工具:
9 Z6 B5 `9 K9 b# xhttps://github.com/ilius/pyglossary$ X9 X! X" @' Q/ u6 w' y. E4 @
https://github.com/SebastianSzturo/Dictionary-Development-Kit
6 E9 V; N- f, a, E; L3 B: u' f$ ~& g, ?. `* {$ t4 ]7 z
转换命令: 1 V R; S+ f" B! l
- python3 pyglossary.pyw ~/Downloads/MBD/Microsoft\ Bing\ Dictionary.mdx ~/Desktop/Microsoft.bing.xml --read-format=OctopusMdict --write-format=AppleDict
复制代码
, f% G9 }) u7 {; _+ C
! ^' U+ V" ]7 l% w C制作苹果字典:
; N9 {# n/ e( s4 j/ F! B把生成的Microsoft.bing/Microsoft.bing.xml 文件复制到Dictionary-Development-Kit目录,并修改对应的Makefile
4 f# ?% f9 w3 p9 t7 `0 m8 N- DICT_NAME = "微軟必應雙向簡明詞典"
8 _# G, f, P/ Y7 L - DICT_SRC_PATH = MyDictionary.xml
: G* ~: Y; c5 l, K - CSS_PATH = MyDictionary.css# X& x+ v* P( J$ ~# G* D0 l" ~. z
- PLIST_PATH = MyInfo.plist
复制代码
2 K0 \; @' X. }5 L' ]5 H
3 c8 S% r/ N; R修改MyInfo.plist
+ X: ^1 h4 {1 E4 L8 f0 J' H- <key>CFBundleIdentifier</key>
& |* j& Q% }+ ]0 z! Z- ] - <string>com.apple.dictionary.microsoft.bing70000</string>/ v9 [. S# ^* D
- <key>CFBundleName</key>
1 y0 L6 `6 N b% E8 _! x X6 } - <string>微軟必應雙向簡明詞典</string>
3 e j; p! `3 l8 v( K% n- r) K: e - <key>CFBundleShortVersionString</key>
复制代码 2 v5 d% Q6 S3 S) n% o
. p8 d: v' k) k
复制Mdict自带的css文件内容到MyDictionary.css,然后执行:
' w, y V) `- V7 G6 A- [~/Dictionary-Development-Kit/project_templates]$ make && make install
' d) Q) x2 J4 t. e9 R0 v - """/Users/usr/Dictionary-Development-Kit"/bin"/build_dict.sh" "微軟必應雙向簡明詞典" MyDictionary.xml MyDictionary.css MyInfo.plist$ K; c8 C# e1 E( a1 O7 ~( A; U7 e4 p
- - Building 微軟必應雙向簡明詞典.dictionary.: j" \+ s8 q `
- - Cleaning objects directory.
2 a8 h& u2 t9 v' t - - Preparing dictionary template.9 C- Q# l- {3 z
- - Preprocessing dictionary sources.
/ H. \" L% S; T( W: n; v - - Extracting index data.& Z, ~( h1 r1 n, g5 D
- - Preparing dictionary bundle.1 a* h. ]7 x/ j! _; s& t
- - Adding body data.
6 G2 I# @* s- y2 l# T% A$ P - - Preparing index data.) d- @; ` ]3 E" S9 S
- - Building key_text index.
+ o2 a+ _* J: L; D5 ~' ?0 [2 z - - Building reference index.1 W3 ^! y6 b8 W+ @" l: v9 O
- * Note: No reference index record.
) C# s- W: Q/ L; K% i - - Fixing dictionary property.
' v! Y& R H# I) Y - - Copying CSS.% H! b7 P5 e. B( {4 [& T0 q
- - Copying other resources.
: H) C2 e. z t9 \: `# }( r0 O) @ - - Finished building ./objects/微軟必應雙向簡明詞典.dictionary.' Z4 o7 v! H3 O
- echo "Done."
. \1 x: ~0 I3 \9 O - Done.
2 g Q9 P( Y7 O& A - echo "Installing into ~/Library/Dictionaries".; c5 S4 H7 w" B2 m3 |8 r
- Installing into ~/Library/Dictionaries.0 t( ?. t- V+ D# D- I
- mkdir -p ~/Library/Dictionaries8 A! M7 e) E: I; h' ~ v. `
- ditto --noextattr --norsrc ./objects/"微軟必應雙向簡明詞典".dictionary ~/Library/Dictionaries/"微軟必應雙向簡明詞典".dictionary
9 Q Z' [* [+ K) N( a L: J - touch ~/Library/Dictionaries
. J$ q5 n/ g, M+ Q - echo "Done."# y9 h* g6 g3 U7 n& a+ Z- p
- Done.
9 o3 g0 p9 i$ o0 L6 p - echo "To test the new dictionary, try Dictionary.app."
复制代码 . t( @( O: o7 Q y
% c0 d) m# M4 J& s6 [7 B: n2 `, O. u* G: x
转换结果:0 ?5 O, s- W( |0 V! x+ y% v3 {
( j h: n3 \$ r$ ^0 ]/ t$ z
7 W5 A/ ?: r$ G# l/ w |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?免费注册
x
评分
-
1
查看全部评分
-
|