|
精华文章啊!!实在忍不住从口袋转载了过来:) 4 A6 d$ \( V6 z' }
9 c6 ?8 m7 S( U+ ^
原作者:linld97044
6 a! f% I) t. Q: @0 F" ]& V) X内容:7 d$ z" X p! \0 ]9 ]) g! N
玩PDA多年,在坛子一向是潜水多贡献少,现在向坛子贡献下做mdict的方法。$ Z/ r8 c6 f; v! G1 h
+ c X- W3 a O+ v* y) M
做专业字典首先的难题是字典源文件,经搜索,看来stardict是比较好的源文件,字典量多货足。可以在以下链接大量下载:: q8 y, m3 J. b) t! }9 D
1)http://www.vayn.cn/sundries/files/stardict-dict.htm
6 s% z+ L. ~: X7 l+ H$ z0 o6 B' t2)http://reciteword.sourceforge.net/stardict/babylon.php: a" f3 _ S6 Z6 m! [0 ` L
3)http://stardict.sourceforge.net/Dictionaries_zh_CN.php
8 ]# U* V( u& w* Q* r* y: q1 z E8 b; @: x
本问题之前在http://bbs.pdafans.com/thread-608906-1-1.html(mdict自定义尝试-美国传统字典+湘雅医学词典+高级汉语词典3合1的mdict(附方法))中讨论过,现基本已解决,发帖总结下:
# l/ g7 C- D) y% r1 |6 g% I; R9 B# N
1、根据mdict作者邮件,比较旧的stardict可以用convstar命令转化成txt后用MDXBuilder 2.5 编成mdict的mdx文件。这一步比较简单,之前的帖子也详细说过了。( R7 v4 {* z S& b! u( \: \( J
^; n) Q+ u6 Y$ ^5 y( r! o% @2、第二种情况是stardict后期的词典,用了不同的编码格式,convstar直接转出现下面类似的错误:
$ v1 J4 I* x5 M6 G" m1 |/ a
% y. l# l8 e4 l3 d2 R, f“Warning unknown mark: k (0x6b), following content will be ignored.& g* g+ v- L: T8 P( q, x! E% |
Summary of ignored marks:
}2 d0 |+ E7 ~7 t( D. i* t7 Xk (0x6b) 96281 times
* y4 _( G( Q2 {3 h, A4 O. SDone!”) s$ i" \2 u- f. E, {5 e
& |+ I; r" f. I4 z6 [8 G) U这种情况不能用http://www.octopus-studio.com里的convstar直接转。应做如下处理:$ M. n m/ s' T5 q. ~
! _) D+ U; g2 Q1)先要用aisnote编写的CvtStarDict2Txt.exe转成txt
5 m5 ~" e' K& d6 ^+ }2 l+ j! X( n( i2)txt用ultraedit编辑成mdict标准格式' m. {" J' w2 A o. P
3)用MDXBuilder编成mdx文件。9 L" ]# @4 T7 X- w
5 C% N: d1 t6 O( \
以stardict-babylon-NEW_Babylon_German_English_dictionary-2.4.2为例给大家示范下stardict to mdict的全过程。2 F4 v, C/ b0 z& q! H3 K9 b; C
, O" L3 ?9 i, m
一、下载文件包,得到stardict-babylon-NEW_Babylon_German_English_dictionary-2.4.2.tar.bz2,该文件可以用winrar解压,得到NEW_Babylon_German_English_dictionary.dict.dz;NEW_Babylon_German_English_dictionary.idx;NEW_Babylon_German_English_dictionary.ifo;NEW_Babylon_German_English_dictionary.syn四个文件。
2 a' k2 v- ~4 ?: k a, v# ^$ @0 P
注,用convstar,出现下列错误信息,说明convstar不能处理该文件:
: \- m# L! R* r" L5 i8 z7 U" |7 P' b3 ~6 Q+ B) g$ y
”C:\>C:\download\MdxBuilder\ConvStar\ConvStar.exe C:\download\German\stardict-bab
6 ?$ c" k, k# y- Kylon-NEW_Babylon_German_English_dictionary-2.4.2\NEW_Babylon_German_English_dict7 n& q- T, c$ F$ R
ionary.ifo c:\g-e.txt$ N1 U+ h" d! s0 P1 H
bookname: Babylon German-English , wordcount 164638" N* p3 X( f; |5 X0 n
Total entries:164638
; ^/ S9 c, J1 |* |4 aWarning unknown mark: h (0x68), following content will be ignored.
/ `% J0 B6 r* WSummary of ignored marks:+ S, ` a5 R9 b/ Q" L5 k# d
h (0x68) 164638 times+ e; w$ k* A g; S9 ]& z. W/ P3 u
Done!“
1 e3 P3 E6 e$ K' T. F Y! I( y7 T0 d& b; d7 e
二、用7-zip继续解压NEW_Babylon_German_English_dictionary.dict.dz,得到NEW_Babylon_German_English_dictionary.dict,该.dict文件应该解压在和另外几个文件在同一目录。
% |/ b( X. n1 S7 J) c9 Z) p" w见图1
, P H' a! g& T' ^ G# R$ U, b; ^, @- Q( b9 k6 t& H/ D
三、启动CvtStarDict2Txt.exe,选择NEW_Babylon_German_English_dictionary.ifo,再点convert。成功后对话框出现:”Word Count=164638. l3 S; Z5 s( u% J, u
=======
3 H. o X2 k, P8 t: p) C- TC:\download\German\stardict-babylon-NEW_Babylon_German_English_dictionary-2.4.2\NEW_Babylon_German_English_dictionary.txt ) j! E6 a$ X$ u K6 C: | i" k
Convert Success!!
) i$ }1 |' _# k; T! E# x======“说明转化成功!
4 z _ L4 O. D3 U/ _/ O见图2
; [" }! q4 C: C# v/ }1 l+ R5 Z- i# B3 m+ m c+ e/ b- `4 n
四、由于要做德英英德双向字典,依样画葫芦下载源转换,得到Babylon_English_German.txt和NEW_Babylon_German_English_dictionary.txt两个文件。
4 r1 r3 S2 |8 l8 T9 e0 c
. {6 s4 e+ k. I7 r五、这2个txt文件在ultraedit打开,提示”do you want to convert to DOS format“,选是。本来想用copy命令合并这2个txt,但copy命令不知为何只拷贝了部分文件,所以这里用ultraedit全选一个txt全部文本,粘帖在另一个后面(Ctrl+End)。得到一个313468行的文件。, x+ A, N5 L5 c( I* k2 Q. e
& I) g' o2 ]2 u5 B% h6 c+ j
六、在ultraedit”Ctrl + R“把换行符”^p"替换成“^p</>^p”,如图,选replace All。就是在每一行加上换行及</>(mdict分节号)。
0 P- z, g3 j5 `* {; r, w, E* k如:$ {5 f0 w8 z, f# V- P, t5 i
“abhorrence <font color="blue">n.</font> Abscheu
8 b1 Y9 m( M- l3 K7 |abhorrent <font color="blue">adj.</font> abscheulich”
1 ]3 C' f% C& E7 l) I3 E* o1 y) O5 T; @
将转成:
8 v& L: t) R4 ]5 R! k1 a2 c2 y"abhorrence <font color="blue">n.</font> Abscheu( a0 u$ W4 W$ L5 N+ v+ I
</>$ G8 u ?1 D- ^, \. {; |: B( L
abhorrent <font color="blue">adj.</font> abscheulich1 R+ G, l4 { K7 n$ e1 G% `
</>"
) a9 F8 p( u: Y1 A+ G" `再用一次替换“Ctrl+R”把 “^t"(Tab)替换成”^p“,转换成:
5 r5 z n- v( Q9 e”abhorrence
. T6 q" \3 Q1 O1 W l1 X<font color="blue">n.</font> Abscheu. y! v$ u1 G) [5 S2 l
</>
_, T1 L* P$ i6 z. U9 uabhorrent4 |2 C* P! |& B4 A! L
<font color="blue">adj.</font> abscheulich
2 w0 {0 A0 D z( z: s# [</>“& D+ R2 V9 d4 U
得到mdx标准txt!存储为DOS Terminators-CR/LF ;UTF-8文件。
8 B; y( } k8 Z2 L+ p0 X1 e3 }/ t4 Q$ i0 {0 _
见图3和图4
# d+ s) Y7 c( c9 {- ~) R7 t' z2 i0 m+ h' i3 Z# i* u# }
七、mdxbuilder出动,注意source选txt源文件,target输入生成文件路径和名称,style应选example-style.txt,original format这里选Mdict(Compact HTML),Encoding选UTF-8.: b- N8 q8 h& R) ]2 Z/ K
见图59 p( ] }. i* m/ t0 I) J. z
0 A0 c* J8 ?0 _0 g& a) O八,完成了,就这么简单: j1 d, W+ p2 X. U# V, R
见图6
0 {# ]5 |) J6 H8 p' t5 j
; P3 n; c9 G, M附上几个必须文件:
2 f- F* \7 ` ?" B& y0 P8 ]+ m' X0 a& d+ I% B- Z! U9 k3 p
CvtStarDict2Txt.exe |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?免费注册
x
|