掌上百科 - PDAWIKI

 找回密码
 免费注册

QQ登录

只需一步,快速开始

查看: 1481|回复: 10

[求助] 【求助】makedict 0.4.1-beta1 + dictconv 0.2的具体使用方法

[复制链接]
  • TA的每日心情
    开心
    2018-1-27 00:16
  • 签到天数: 1 天

    [LV.1]初来乍到

    发表于 2015-6-29 07:22:09 | 显示全部楼层 |阅读模式
    各位坛友好。' J7 M2 o* |& G' Y
    5 k6 m* n1 x8 M1 W3 d  s2 p' S" L
    友坛中有一个专门关于stardict的帖子,上面提供了转换bgl和dsl到stardict的方式。! v" y# h1 u, e( Z" b. Y/ B

    . e$ K. k" n# D7 f4 _; K1 ^4 D$ Ghttp://forum.ru-board.com/topic.cgi?forum=5&topic=16486- z7 K8 W' b3 N' ]6 A' q# C

    1 i( P8 K  W; v  {' Q0 [Код:
    ) H# L# V4 U, N. W( z
    4 g9 Y: n* U) d- |+ N( u( d- a; f! z#!/bin/bash . U* l7 @' a4 @6 r9 W( I
    PATH_DSL=$1 & s( n  D* S. H" l2 `2 d+ g0 B
    PATH_CUR=`pwd`
    . ]# j6 c  c8 h% smkdir $PATH_CUR/stardict
    . v& ?+ ]6 T9 n1 l0 g; D/ tmkdir -p $PATH_CUR/tmp/tmp
      p) B$ u7 \0 Q8 \7 ?for i in $(ls $PATH_DSL | grep dsl$); do \
    * ?& u6 g" \$ Q  p* t/ z' ecp $1/*.ann ./tmp && \ 2 ?# h7 X. E  \3 N. e4 S% P0 ^
    iconv -f utf16 -t utf8 $PATH_DSL/$i | sed -r 's/\[s\].+\.wav\[\/s\]//' >$PATH_CUR/tmp/$i.utf8 && \ , h, g# v  ~' a/ t0 b
    iconv -f utf8 -t utf16 $PATH_CUR/tmp/$i.utf8 > $PATH_CUR/tmp/$i && \ : e. ]! w3 ^7 L* l
    rm -f $PATH_CUR/tmp/$i.utf8 && \
    " h! [$ [' X- I$ g! g6 W0 F7 L5 Tmakedict -i dsl -o stardict $PATH_CUR/tmp/$i -d ./tmp/tmp; done 1 a+ z) D% [- J% ^% {  \
    find $PATH_CUR/tmp/tmp -iname "*.*" \! -type d -exec mv \{\} $PATH_CUR/stardict/ \; ! |$ k% W1 y2 m; h3 m) K
    for i in $(ls $PATH_CUR/stardict | grep dict$); do dictzip $PATH_CUR/stardict/$i; done - X& Q  x* v" p6 N& M
    for i in $(ls $PATH_CUR/stardict | grep idx$); do gzip -9  $PATH_CUR/stardict/$i; done
    $ r4 Q0 _/ e, ~! m' r. a5 n8 Y; Urm -R $PATH_CUR/tmp : s, S. R4 k1 ~: `' m# L
    echo "Done"" 7 L8 z- C8 W7 y. K
    7 X( a6 d/ M4 q' z
    % O6 k* `  }* c# L

    ; V4 T# s; u% o2 K5 T$ I* r$ N上面的这段文字作何解释呢?
    ) i$ O6 E5 u# p% `$ m
    9 J: Q$ `; {; y5 u- j4 K1 }具体转换步骤是怎样的呢?不安装某些相应的软件或者导入某些环境变量好像在windows在无法直接使用 makedict  + dictconv呢。不知道哪位可以指导一下,多谢。

    该用户从未签到

    发表于 2015-6-29 09:17:48 | 显示全部楼层
    需要Linux环境,不过那里提供了windows版" Z8 y& E; q, U5 o
    http://coldpizza.narod.ru/makedict_dictconv_win32.zip
    . _' t" \8 G" t8 D0 l" i: j7 n* U$ c
    1. makedict.exe -i dsl -o stardict имя_словаря.dsl
    复制代码

    5 _* g' L$ C. Y! V- s: Z% S* O或者用$ ~: C$ w- B  w' L# J( b5 [
    pyglossary
    ' L. d) r- f9 X3 ]' nhttps://github.com/ilius/pyglossary. f: f( j6 ?# ?4 t
    python /Applications/Utilities/DictionaryDevelopmentKit/pyglossary/pyglossary.pyw --read-options=resPath=OtherResources --write-format=Stardict xxx.txt xxx.ifo
  • TA的每日心情
    开心
    2018-1-27 00:16
  • 签到天数: 1 天

    [LV.1]初来乍到

     楼主| 发表于 2015-6-29 11:48:29 | 显示全部楼层
    多谢楼主的大大!非常感谢!!
    , E' k+ k" G0 E7 l/ e1 A按照大大的方法成功啦!感谢感谢!! f5 [  @: v( i& g( s( V
    8 M- h# l* g2 W9 A: N% e: D' Z% o

    - t: T$ ?* K9 K& {8 ]5 K( i另外那个dictconv.exe的命令转换babylon的BGL的时候如何写呢?看了下说明还是不怎么明白。
    / u7 g9 P0 p5 f2 H1 E4 V/ t: h' A* R% K0 }! |! f  E5 a# t( t  E
    ( @! X& I6 O5 P

    ' p8 \- _4 f2 b; MUsage: dictconv [-hv] -o OUTPUT_FILE INPUT_FILE1 X/ ]/ x6 G. P: F0 ?

    ) t: o& ], B) s3 v9 EConvert INPUT_FILE dictionary to OUTPUT_FILE dictionary.
    0 x2 U9 V  @; N* ZThe extension of file determines the dictionary type.
    ( l( m1 H3 Z6 ~% s: {5 D" N1 I: O
    0 b! C  ?9 ~& B6 F# G  -o  OUTPUT_FILE       path to target dictionary  B" ~- q$ Q( _9 N! w8 h
      INPUT_FILE            path to source dictionary: }0 M. N% R& i6 d0 @4 |& p
      -h                    print help message and exit
    + x0 H# M4 X& ?9 t. T: o, M  -?                    print help message and exit
    7 Z9 v: M2 _: e8 O( h  -v                    shows the version information and exit$ u' G, d3 |6 ^  y0 S* t4 o$ y

    1 c/ b4 ~. `; B* lINPUT_FILE can be:/ T1 s, _. i$ j7 q8 J
      Babylon Glossary (.bgl)( v4 A* P3 d! R
      Freedict dictionary (.tei)
    4 E- m, U! o9 D5 O4 w  Sdictionary dictionary (.dct)' L8 m. y1 h/ q3 Q, A% E
      StarDict dictionary (.ifo)
    , f  b7 h; V9 T+ b) x+ b& X9 L4 P
      u- E' L6 ^- ?& m8 LOUTPUT_FILE can be:
    : f$ h' ?" Y) N  DICT dictionary (.index)$ U: J. h8 x& s2 q1 E( z
      PlainText dictionary (.dic)* X/ s# ~! ]$ \
      StarDict dictionary (.ifo). H0 m9 E6 a6 a- q/ \
    6 j1 z& H* c+ C. E
    ( D0 W. l9 D" @  z9 Q) z- ?1 B2 Y
    E:\makedict>dictconv.exe -o stardict Merriam_Webster_Advanced_Learners.BGL
    9 D" j5 {8 M( o7 o0 Q- cYou should specify a valid output file./ ]/ m, }; m& C

    2 Q% ?$ d! X* r, UE:\makedict>dictconv.exe -o 1.ifo Merriam_Webster_Advanced_Learners.BGL4 T% K' N3 s: a8 k
    terminate called after throwing an instance of 'std::out_of_range'# x( Z( _$ z/ q2 v) N) u" S: M! T
      what():  basic_string::compare
    2 p9 ^1 }$ B0 Y( z) e# I      1 [sig] dictconv 11696 open_stackdumpfile: Dumping stack trace to dictco
    ( k$ @" ^: T# U1 s# J.exe.stackdump( p& U7 L5 Y% w6 s7 U$ `) t
    6 g; Q; J0 u9 K* T3 R6 j7 d
    E:\makedict>2 g0 Y" F  O2 \. {

    1 a8 w9 q' h3 I% w2 S2 r  n% q7 {: v1 ~
    胡乱尝试了几次还是不成功,烦请大大一并赐教,多谢。
    # ~0 W1 y, b4 r+ N) K( X

    该用户从未签到

    发表于 2015-6-29 12:22:37 | 显示全部楼层
    本帖最后由 qunwang6 于 2015-6-29 12:29 编辑 : O& j1 Y  }+ [" X
    liuyunrushui 发表于 2015-6-29 11:48
    . I+ y# r" c6 Z# T, B, ^多谢楼主的大大!非常感谢!!2 b0 ~& r3 U* f: i9 S1 d  v: K: n
    按照大大的方法成功啦!感谢感谢!

    & [' z$ v' D/ b2 J8 m4 |" U/ P' L5 [+ g) a. b
    需要完整路径:dictconv -o c:\xxx.ifo c:\xxx.bgl不过会提示找不到iconv) Q! Z2 ~) s) n0 |, O% e: `
    其他方法
    7 n. `6 B2 j+ h0 y, }编译成StarDict格式的词典
    * f$ A/ L# V1 j* W8 n5 D2 M方法一:
    1 l3 r1 \- z" o4 Z3 z  GStarDict Editor9 a% D+ |2 k# ]5 d9 y  z5 K; e5 x6 f
    https://code.google.com/p/stardictproject/downloads/list+ k9 T, c( l/ W+ C0 T/ _
    官方版本会有问题
    9 [( M' _- d* g& h! ~搜索3.0.3便携版,里面有stardict editor& I# v/ X& c$ X# n
    StarDictPortable-stardict.sourceforge.com_3.0.3.paf.exe
    ! N) z7 g& L6 k$ `方法二:2 I- n3 A! F  x. }+ W7 k4 h
    pyglossary
    - s3 r7 C% t2 k" f7 thttps://github.com/ilius/pyglossary; `$ \8 y" i. M' D5 q
    python /Applications/Utilities/DictionaryDevelopmentKit/pyglossary/pyglossary.pyw --read-options=resPath=OtherResources --write-format=Stardict xxx.bgl xxx.ifo
  • TA的每日心情
    开心
    2018-1-27 00:16
  • 签到天数: 1 天

    [LV.1]初来乍到

     楼主| 发表于 2015-6-29 13:54:43 | 显示全部楼层
    qunwang6 发表于 2015-6-29 12:228 b" W! a( m( W# @( A, [. k) W
    需要完整路径:dictconv -o c:\xxx.ifo c:\xxx.bgl不过会提示找不到iconv
    / }% U6 k  U: i) e其他方法% Q' ^- p' _% b. v( N! d2 O
    编译成StarDict格 ...

    & X! U) s( c& r3 f2 N/ H+ C. ?多谢老大!2 I9 _+ ?( x/ k5 E" w7 t: k
    ; a$ h, ?5 Z0 T) s" Y; l+ d% a
    1。直接用dictconv果然会出现错误:& ]8 x3 {3 u; ~, Y" A9 y. c
    5 v  Z1 a+ [4 c) X: {9 }3 \- i1 {; d
    E:\makedict>dictconv -o e:\makedict\Merriam_Webster_Advanced_Learners.ifo e:\mak
    ; X/ P; \! C) Tedict\Merriam_Webster_Advanced_Learners.BGL
    3 X) G" w$ z% @& N' D) Jcygwin warning:* W+ g+ W% b" S# k
      MS-DOS style path detected: e:\makedict\Merriam_Webster_Advanced_Learners.BGL
    , s, ~* E) H2 I, c: `: R  Preferred POSIX equivalent is: /makedict/Merriam_Webster_Advanced_Learners.BGL
    ) s2 ^. ]6 f% ~- Z3 r. H
    ( b$ c# l( y# ?+ h  CYGWIN environment variable option "nodosfilewarning" turns off this warning.
    2 f9 s( X8 F2 n# J8 V2 O. n  Consult the user's guide for more details about POSIX paths:
    7 j1 o/ _$ x, ^: G% g* q  H    http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
    0 w$ B$ l6 X& o" U  I1 [2 z5 {: z$ p3 n" YError openning iconv library1 R  B9 ~: s$ F  L9 }6 t

      I6 j8 ?5 d5 P9 ^E:\makedict>! c# C# h9 Z  J8 }, R  y' t  r
    + j. X& U1 L2 T
    2.下载了您说的这个编辑器StarDictPortable-stardict.sourceforge.com_3.0.3.paf.exe,安装后转换bgl的时候出现问题,如下:& j6 P) y9 Q: n) M
    / {" z( H# ^# N; N8 R4 X& f- U
    Building...
    6 Z, W0 @4 X: N* g! u[critical] Error, no new line char after word line: 1.
      Z: @( c$ w1 N, T' LDone!1 x4 `  Q2 ~& _6 @1 Q+ O  r
    $ x: _2 b( r6 p" T5 t8 Y
    不知何故。
    ! H( Z" V1 e" k7 l( b4 X
    ; l: \# u. o. {$ @3.晚些时间试一下您推荐的这种方式
    2 O3 a) u  {8 M# g6 }2 D4 w3 s5 ]& M
    , H& T4 J. ?% {, g" kpyglossary. A$ l$ j. [. l3 d9 k8 ^
    https://github.com/ilius/pyglossary
    % l6 K; a9 ?7 N4 m, P7 ], D2 k6 {( F% M0 g( x
    万分感谢楼主大大!谢谢。
    $ F) c7 J3 |: h- a! Q4 Y/ Z) {
    6 V) [* l+ @$ N* L9 D: Q  P5 T

    该用户从未签到

    发表于 2015-6-29 16:35:59 | 显示全部楼层
    liuyunrushui 发表于 2015-6-29 13:54
    : J) @8 p6 R# u# ^6 r" y" `多谢老大!
    0 ?1 X( m' h+ G( n  q1 |) n5 b! ]3 Q3 P) c7 m
    1。直接用dictconv果然会出现错误:

    . ~0 |- C4 j; e6 z, [3 t8 Y5 T/ p+ |6 D! J4 t8 Z0 Q
    所谓Babylon格式应该是要提取出文本,如何再用stardict editor转。0 E) a# b# g# E' X- E8 i8 \" ^
    还有另一种方法用pyglossary把bgl转为table格式,然后再用stardict editor转。1 M( ~: s! c2 [1 P* f( B$ z8 G
    python /Applications/Utilities/DictionaryDevelopmentKit/pyglossary/pyglossary.pyw --read-options=resPath=OtherResources --write-format=Tabfile 2.bgl 2.txt9 X. ~: h. i* m8 w' }6 h. L
    不过可以直接
    ' y9 T3 i; \  E, ]4 ]5 l2 dpython /Applications/Utilities/DictionaryDevelopmentKit/pyglossary/pyglossary.pyw --read-options=resPath=OtherResources --write-format=Stardict xxx.bgl xxx.ifo

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?免费注册

    x
  • TA的每日心情
    开心
    2018-1-27 00:16
  • 签到天数: 1 天

    [LV.1]初来乍到

     楼主| 发表于 2015-6-30 10:35:00 | 显示全部楼层
    qunwang6 发表于 2015-6-29 16:350 U7 J6 d" O) A' X# ?; Y0 Y& g# h
    所谓Babylon格式应该是要提取出文本,如何再用stardict editor转。& `$ }: F+ k* A7 V/ y+ G' n$ r
    还有另一种方法用pyglossary把bgl ...

    / F9 A) I0 Q4 I. G* j多谢指教!$ p! \: ]* E9 l% f4 i4 i0 d
    3 c+ _6 }$ k; Y* D' f  [' L
    非常感谢!
  • TA的每日心情
    开心
    2018-1-27 00:16
  • 签到天数: 1 天

    [LV.1]初来乍到

     楼主| 发表于 2015-7-1 14:38:14 | 显示全部楼层
    qunwang6 发表于 2015-6-29 16:35
    4 Q/ l- j1 W' K8 i/ C- f5 v所谓Babylon格式应该是要提取出文本,如何再用stardict editor转。
    0 d' }5 i& Y3 @6 B6 I还有另一种方法用pyglossary把bgl ...
    , Z+ |2 K" T; ]2 \) {2 @3 d4 q- v7 g/ `
    老大您好!
    1 {: e" U# x1 |$ W又来讨教了。2 L/ j5 Y7 j- P2 K  H$ Z9 M" w6 o

    $ f- a) M; ?' @3 _$ m我下载了一部Macmillan English Dictionary,dsl的转换为tab文件后,用stardict-editor编辑为stardict的文件之后,用ebwin载入,发现html标签都显示出来了,ebwin显示结果具体如下,不知何故。我把txt文件传到百度云了,如果您有时间烦请指点一二,多谢多谢。
    ; E+ u, y4 V6 `5 w5 A
    ) Z& m) B- Z* v3 ~1 }. Z<k>take</k>% A! V+ Q1 _1 {
    <b><font color=darkmagenta>&#9642; <c>I.</c></font></b> <b><font color=red>take</font></b> <sup>1</sup> <abr>UK</abr> <rref>zzz_uk_B_B34_B3447_B3447310.wav</rref>
    4 E0 o( }1 G% O4 ~5 B. z% O  a
    5 V  j) p& I3 M0 v- l7 \百度云地址:
    3 j# \5 o. s5 o" s3 G链接: http://pan.baidu.com/s/1bnEtV9H 密码: 6bx43 a# O) c5 n: D: x% w% u; U

    % d. i" u* K% U" j9 L3 c
  • TA的每日心情
    开心
    2018-1-27 00:16
  • 签到天数: 1 天

    [LV.1]初来乍到

     楼主| 发表于 2015-7-1 14:51:38 | 显示全部楼层
    stardict加载该词库后还是一样,各种标签都显示出来啦!6 Z8 ^+ G, h; D  s% C0 Q

    9 f* h8 G2 j7 c3 _/ [4 @/ Q) q3 x怪哉!; a# g* s7 W8 A+ L

    / Y1 ?, }, T) r8 ]- l我再网上下载过一些stardict的词库,用ebwin加载时可以显示颜色的呢!* l7 x0 }& h0 a2 v8 `

    ) S# J7 O. z/ m8 ^" L& T6 [肯定是哪个地方出错了!有给您添麻烦啦!多谢!0 K2 C  o6 ?+ M% G

    该用户从未签到

    发表于 2015-7-1 15:24:12 | 显示全部楼层
    liuyunrushui 发表于 2015-7-1 14:51$ c$ T2 L) B$ d
    stardict加载该词库后还是一样,各种标签都显示出来啦!( K8 u5 ~7 Q) v# a, V. `
    # Q: |5 m6 q; @* p
    怪哉!
    # J# A/ `7 f( L# X, q
    打开.ifo文件将里面的sametypesequence=m改为 sametypesequence=h
    & B  n2 D% S* ~h代表html
    " K* n% F$ P' S& \3 q( J$ X
    Stardict editor assumes the input and therefore output is plain text.
    & _: B7 ]" [  D' e) o; W5 g4 A' aJust open your .ifo file and change sametypesequence=m to sametypesequence=h
    ! N4 B5 b9 |+ h9 N  |* wThen reindex the dictionary in GoldenDict.
    & T. d" I" ]( ]
    " ~0 _( |! |  |9 r8 ?For more info about "sametypesequence" check http://code.google.com/p/babiloo/wiki/StarDict_format
  • TA的每日心情
    开心
    2018-1-27 00:16
  • 签到天数: 1 天

    [LV.1]初来乍到

     楼主| 发表于 2015-7-1 20:30:06 | 显示全部楼层
    qunwang6 发表于 2015-7-1 15:24
    6 u* u9 Q, C9 D9 b4 |6 ]打开.ifo文件将里面的sametypesequence=m改为 sametypesequence=h
    , ^% E+ T& W' {9 N3 Rh代表html
    : y; o5 `- P- b( j2 x
    非常感谢您!
    $ j. K& l2 g) K6 c& A9 t! h2 Q" w2 j
    , f6 ?$ M" O5 X! h4 k9 Z- u% s! l5 z搞好了,多谢!* s/ g6 u( ], J7 F! x

    4 T% J8 V) H. z2 i) @. v
    您需要登录后才可以回帖 登录 | 免费注册

    本版积分规则

    小黑屋|手机版|Archiver|PDAWIKI |网站地图

    GMT+8, 2025-5-8 09:57 , Processed in 0.022796 second(s), 22 queries .

    Powered by Discuz! X3.4

    © 2001-2023 Discuz! Team.

    快速回复 返回顶部 返回列表