掌上百科 - PDAWIKI

 找回密码
 免费注册

QQ登录

只需一步,快速开始

查看: 1524|回复: 10

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

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

    [LV.1]初来乍到

    发表于 2015-6-29 07:22:09 | 显示全部楼层 |阅读模式
    各位坛友好。; u9 x. l' z* @! T

    * D8 q4 P+ ?: W8 B8 V  r友坛中有一个专门关于stardict的帖子,上面提供了转换bgl和dsl到stardict的方式。
    0 T6 l" X" r. b- ]+ _0 B1 _: x1 R  D6 p, c5 U) A( t- P) C
    http://forum.ru-board.com/topic.cgi?forum=5&topic=164861 n+ r" ^6 E+ ?( H: ?+ y

    0 V3 c# Y( \# V# G7 R* e. B& ZКод:
    & b. J, I1 h4 l5 K
    2 b! B# R5 o: h7 z3 `2 g& \#!/bin/bash + G/ y$ b/ q# D: C. I) X2 U! _
    PATH_DSL=$1 - @9 V3 w0 _- `% u5 I
    PATH_CUR=`pwd` - C2 z1 e! j7 M$ z: O4 m
    mkdir $PATH_CUR/stardict
      \/ z( C% @7 m- w" [mkdir -p $PATH_CUR/tmp/tmp
    , y. q5 [5 s  L' s& r) Vfor i in $(ls $PATH_DSL | grep dsl$); do \
    " h+ L- f) U  ^! B0 Bcp $1/*.ann ./tmp && \
    , {$ J& X; w5 t# M) a" L: w2 [4 Xiconv -f utf16 -t utf8 $PATH_DSL/$i | sed -r 's/\[s\].+\.wav\[\/s\]//' >$PATH_CUR/tmp/$i.utf8 && \ % ?- \! J, j, D/ Y0 I) O8 K) c
    iconv -f utf8 -t utf16 $PATH_CUR/tmp/$i.utf8 > $PATH_CUR/tmp/$i && \ 5 N% b: O: ^3 d( G- i$ `& T
    rm -f $PATH_CUR/tmp/$i.utf8 && \
    * ^! d/ n: \* m0 l2 |makedict -i dsl -o stardict $PATH_CUR/tmp/$i -d ./tmp/tmp; done ( m8 _* V. M- ?8 ]4 `
    find $PATH_CUR/tmp/tmp -iname "*.*" \! -type d -exec mv \{\} $PATH_CUR/stardict/ \;
    2 q; Q; f. p$ A3 O' K1 Hfor i in $(ls $PATH_CUR/stardict | grep dict$); do dictzip $PATH_CUR/stardict/$i; done 8 n' w: M7 v' h; E
    for i in $(ls $PATH_CUR/stardict | grep idx$); do gzip -9  $PATH_CUR/stardict/$i; done 3 m3 r' ^" F/ `9 ]) ]
    rm -R $PATH_CUR/tmp
    * u+ O. K4 s$ r4 decho "Done""
    6 ]# J- g: ^9 r) N2 `8 d
    5 h' L( q' q6 S6 B2 k7 t. ?) H( ]) }( F4 S/ Z6 _
    ; l6 \1 E' Y* ~
    上面的这段文字作何解释呢?
    0 q: d/ n& h3 j9 L
    9 a3 E! `# D# Q' T; i具体转换步骤是怎样的呢?不安装某些相应的软件或者导入某些环境变量好像在windows在无法直接使用 makedict  + dictconv呢。不知道哪位可以指导一下,多谢。

    该用户从未签到

    发表于 2015-6-29 09:17:48 | 显示全部楼层
    需要Linux环境,不过那里提供了windows版
    + _; _: b' W5 Mhttp://coldpizza.narod.ru/makedict_dictconv_win32.zip. H( d, S. \9 T" ]+ a
    , j- `4 _: X, Q; p2 v( _  @
    1. makedict.exe -i dsl -o stardict имя_словаря.dsl
    复制代码
    , U7 R- `/ i0 Z! \3 ^3 y& H
    或者用
    4 ]$ j2 _  C( K( tpyglossary  o, s! w  e' U4 c% v+ k- u; h* f
    https://github.com/ilius/pyglossary
    7 u4 X/ u) S. V9 jpython /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 | 显示全部楼层
    多谢楼主的大大!非常感谢!!
    : F: v$ y( ^( e! Z9 r按照大大的方法成功啦!感谢感谢!
    ; j$ t! U8 n+ E. H$ p7 H0 {8 e" q, d
    # j- T) \8 b/ ^" q/ S
    另外那个dictconv.exe的命令转换babylon的BGL的时候如何写呢?看了下说明还是不怎么明白。
    1 F# Y( F' b1 g) y. f% [! o; B. u3 V
    1 P0 f: X, U& a* P2 F$ o6 z. U
    ! {+ K' S' j: B$ r3 @0 f' M
    Usage: dictconv [-hv] -o OUTPUT_FILE INPUT_FILE8 m3 _$ J- F' h" k: f" d; W! D

    % r7 O- Y% Y: u$ a. x( G, O3 tConvert INPUT_FILE dictionary to OUTPUT_FILE dictionary.
    6 `8 N( R" z  q  yThe extension of file determines the dictionary type.1 F, t7 Y  B2 x# n* o" ?

    : A9 ~( X8 M5 v6 Q  -o  OUTPUT_FILE       path to target dictionary' t5 X4 C; M. |
      INPUT_FILE            path to source dictionary! W7 `% {4 z  o. E2 R' v
      -h                    print help message and exit
    & z8 i% C4 c# b5 Z% o  -?                    print help message and exit
    5 Y- N5 _, [+ G# u& F  -v                    shows the version information and exit# J* c, B) Q8 d* o
    ; @# z: o8 w7 z6 i# v
    INPUT_FILE can be:
      Q- C+ c2 r$ L+ Q6 P4 v  m  Babylon Glossary (.bgl)( P1 V! o- w+ c
      Freedict dictionary (.tei)
    8 [, h0 I, p  o# D$ p' @& \; m  Sdictionary dictionary (.dct)- }* ]' v, }, m, H7 ?7 }
      StarDict dictionary (.ifo)3 I4 M, E& J" I/ j, {% D( y4 E6 I' S
    9 n  B; m+ R. i- \) o
    OUTPUT_FILE can be:
    . a9 C7 H" S+ `/ F' L/ [  DICT dictionary (.index)
    : o% G4 [2 K; J( r, F+ }. B  PlainText dictionary (.dic)4 k3 m: p. L6 a/ Q
      StarDict dictionary (.ifo)) w8 j2 X4 @4 A) c

    / h0 N/ S, m0 c" e3 T0 G
    0 I! Q) m+ f6 S9 O$ F/ xE:\makedict>dictconv.exe -o stardict Merriam_Webster_Advanced_Learners.BGL
    , i0 ^% i6 ~- qYou should specify a valid output file.
    + D1 y6 m" N: Y" R2 |, D
    . Z' ]& x* o( e5 ~+ S) T" QE:\makedict>dictconv.exe -o 1.ifo Merriam_Webster_Advanced_Learners.BGL. g8 [# t7 \: s; L# {
    terminate called after throwing an instance of 'std::out_of_range'- M% i0 o# J  E$ [0 `& T/ L! h
      what():  basic_string::compare, f7 |' K& E* C
          1 [sig] dictconv 11696 open_stackdumpfile: Dumping stack trace to dictco
    / x2 H" ^$ f# x  i7 t; N.exe.stackdump
    . [" ^" B& U, T* W$ l3 I1 w4 t3 `; u/ C( [: S* u- r" L% x
    E:\makedict>
    & T& |4 }& m' b2 {! T
    $ R& e5 K$ m. T8 g0 `
    / j! r: b! D0 r7 Q% ^! G胡乱尝试了几次还是不成功,烦请大大一并赐教,多谢。. t' ]+ t0 Q" p2 k

    该用户从未签到

    发表于 2015-6-29 12:22:37 | 显示全部楼层
    本帖最后由 qunwang6 于 2015-6-29 12:29 编辑 " @/ ^# ^, I# I/ w7 {) ]
    liuyunrushui 发表于 2015-6-29 11:489 X6 C- U: ~8 B" g( M
    多谢楼主的大大!非常感谢!!
    * C, A; C- z- C按照大大的方法成功啦!感谢感谢!

    & X) m1 R& W2 S8 B( F9 f- ]; {5 N6 @
    需要完整路径:dictconv -o c:\xxx.ifo c:\xxx.bgl不过会提示找不到iconv
    * f+ H  ~- w' {+ b; C; ~0 X其他方法" x! G; j2 O. K) h- g
    编译成StarDict格式的词典
    8 {0 N# ^  J" j- M方法一:
    ( [" Z* Q2 ]4 a/ ?" c8 sStarDict Editor
    $ h+ R$ Q) Z7 }! c# m8 qhttps://code.google.com/p/stardictproject/downloads/list
      Y  R; f/ y* P# w* X& F7 J官方版本会有问题7 Z$ N! Z9 S  K. Y6 @& |# B
    搜索3.0.3便携版,里面有stardict editor
    5 Z8 ]1 y" T) @/ J5 b+ L) c9 oStarDictPortable-stardict.sourceforge.com_3.0.3.paf.exe
    9 b# i! w8 P6 \  w4 Z4 _+ t2 G方法二:
    / E) Q' l1 p( u, M$ Xpyglossary2 h1 N. T$ Q' ?9 r; H
    https://github.com/ilius/pyglossary' @0 G, r2 T+ K3 r* o
    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:22
    / j8 Q) H9 S" d4 Q4 `6 \8 ^4 ?# N3 B3 ~需要完整路径:dictconv -o c:\xxx.ifo c:\xxx.bgl不过会提示找不到iconv" u% e( w6 g+ s& R
    其他方法
    ' R0 d0 ^+ j, r# d/ {编译成StarDict格 ...

    - k" X8 {: v5 u$ H, l& O多谢老大!. `. H- j1 Q& _# t; v: ]
    ; e% [  e! O$ D" H! A1 T1 r- J
    1。直接用dictconv果然会出现错误:
    # [6 Z! y  }. C: g
    6 o  N# t' H- d$ V' u9 s& s" A, E: aE:\makedict>dictconv -o e:\makedict\Merriam_Webster_Advanced_Learners.ifo e:\mak( Q. d, I1 D3 w7 u' V3 `8 N0 ^7 a
    edict\Merriam_Webster_Advanced_Learners.BGL% w9 C/ C: ~' P- Z4 z5 L- f- C- G' f) W
    cygwin warning:5 ~# Z( u/ T. q# O4 @# m
      MS-DOS style path detected: e:\makedict\Merriam_Webster_Advanced_Learners.BGL
    ! V9 A- V5 J9 c0 q6 P$ F- {$ s  Preferred POSIX equivalent is: /makedict/Merriam_Webster_Advanced_Learners.BGL
    6 [' S4 f2 y( r" Y* f/ t1 B* O; g9 P9 t" d1 f
      CYGWIN environment variable option "nodosfilewarning" turns off this warning.
    / x0 u$ A, L2 @; {6 ]5 a  Consult the user's guide for more details about POSIX paths:
    8 G6 Y( X0 h: f  ~" f) ]' B- N: m    http://cygwin.com/cygwin-ug-net/using.html#using-pathnames5 Z7 K$ z. w+ B5 t  t; V
    Error openning iconv library: i( V, B8 ]$ U/ X( ]6 B* S9 L% B

    " C- i4 `( l) x* p  Z4 WE:\makedict>
    / E: _! O* S' l# G: r8 w& A( {, L+ l4 S: O+ a& s( R
    2.下载了您说的这个编辑器StarDictPortable-stardict.sourceforge.com_3.0.3.paf.exe,安装后转换bgl的时候出现问题,如下:
    3 ^2 E0 ^& j- `& l9 T* y% j3 `$ S1 ^% w5 @
    Building...
    4 I4 w% ?& v: O; s0 s% w4 E  m6 p[critical] Error, no new line char after word line: 1.
    0 e* E) ~; |+ k$ B5 a0 [" ]Done!
    6 a$ _; x( L! ^" h- ^
    - W+ ?8 o. z5 @不知何故。7 P; m. ^$ T% S$ I, r

    3 d. A7 Q1 b2 }* |% Q  m; j4 d/ ]3.晚些时间试一下您推荐的这种方式
    : Z& @2 B2 Y. B. v
    + j' W( O# ]# K+ Z: \pyglossary5 K0 o& i2 G, O  n/ S
    https://github.com/ilius/pyglossary8 `8 O2 K; O* D; F) J

    + A# f. J$ J, l  y3 H# ?万分感谢楼主大大!谢谢。6 K. s5 z/ O3 R# ]
    2 i# R$ g# c/ W& ~

    该用户从未签到

    发表于 2015-6-29 16:35:59 | 显示全部楼层
    liuyunrushui 发表于 2015-6-29 13:548 K+ o- ^% ?1 ~6 M% \' L6 v" U
    多谢老大!
    5 A3 B' R1 U; P3 z! L; z- w1 b8 D) P) d! B1 h$ y
    1。直接用dictconv果然会出现错误:

    ) ?9 n, B! A% e. f2 {% e9 j, I3 [, B9 m6 x- V' C! i
    所谓Babylon格式应该是要提取出文本,如何再用stardict editor转。
    : y9 k& [% H1 g9 ?+ T* F还有另一种方法用pyglossary把bgl转为table格式,然后再用stardict editor转。
    ) }% T! B; P% Z: f4 gpython /Applications/Utilities/DictionaryDevelopmentKit/pyglossary/pyglossary.pyw --read-options=resPath=OtherResources --write-format=Tabfile 2.bgl 2.txt+ ?+ V' |8 Q1 }. V
    不过可以直接( X1 B( n" C$ }# I' ~6 m' o4 V
    python /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:35
    2 o( Q) P8 v4 p# Q8 M2 k; q) g所谓Babylon格式应该是要提取出文本,如何再用stardict editor转。
    7 d0 ^8 p0 c( U* q+ f还有另一种方法用pyglossary把bgl ...
    ( `. B7 h: J5 o- e0 e
    多谢指教!
    6 |. a4 p* n+ b9 U, K% r' S3 e4 ~! Y! p9 ]4 T. T5 G
    非常感谢!
  • TA的每日心情
    开心
    2018-1-27 00:16
  • 签到天数: 1 天

    [LV.1]初来乍到

     楼主| 发表于 2015-7-1 14:38:14 | 显示全部楼层
    qunwang6 发表于 2015-6-29 16:35
    2 x$ ^! s! k- r所谓Babylon格式应该是要提取出文本,如何再用stardict editor转。
    * l% d% Y! I" R5 ^2 E6 a/ Z还有另一种方法用pyglossary把bgl ...

    ( a& C1 O) S/ A& T. L老大您好!
    2 v( Y: c# D" _2 q% v: K2 H0 O又来讨教了。. L# N/ H" f0 s) [3 e* i! K

    , h9 t# T. k5 K我下载了一部Macmillan English Dictionary,dsl的转换为tab文件后,用stardict-editor编辑为stardict的文件之后,用ebwin载入,发现html标签都显示出来了,ebwin显示结果具体如下,不知何故。我把txt文件传到百度云了,如果您有时间烦请指点一二,多谢多谢。; N( [( b2 A" w# B6 q$ y

    ! l$ C* e* f( C8 U% U<k>take</k>) N6 K+ S* N0 w. s1 V
    <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>
    , G% B$ T) a1 d6 K8 F$ ?
    4 w. [. p; w1 f- `8 w0 i百度云地址:( }' ]. Z  L/ Q) d/ [
    链接: http://pan.baidu.com/s/1bnEtV9H 密码: 6bx4% Z2 L) K, z# K5 I7 F0 s9 d, C

    * d6 t, B" w. ?2 G/ P, L7 B0 t  K
  • TA的每日心情
    开心
    2018-1-27 00:16
  • 签到天数: 1 天

    [LV.1]初来乍到

     楼主| 发表于 2015-7-1 14:51:38 | 显示全部楼层
    stardict加载该词库后还是一样,各种标签都显示出来啦!3 b1 c- Z3 \  m0 ^

    3 \, \9 p" b6 z4 P5 h& }. z怪哉!
    7 Z+ L% f* A  g, ]* C. e, x& F8 y( z5 v$ J- W3 s: P1 Z
    我再网上下载过一些stardict的词库,用ebwin加载时可以显示颜色的呢!
    % L& a3 m- c; Z* L
    & n' ^- H8 e# `2 j1 O- }, N/ L2 Q肯定是哪个地方出错了!有给您添麻烦啦!多谢!( |# O9 [9 }3 R  u1 u

    该用户从未签到

    发表于 2015-7-1 15:24:12 | 显示全部楼层
    liuyunrushui 发表于 2015-7-1 14:519 [9 q' {6 j+ h  p. j" {
    stardict加载该词库后还是一样,各种标签都显示出来啦!3 j- @: B7 c! f" o& n6 r% w
    + F' v; n8 O7 L' s" L; x$ |. r
    怪哉!
    2 d( P) L' W0 a, Q$ M. O
    打开.ifo文件将里面的sametypesequence=m改为 sametypesequence=h
    ! z% o' I6 s8 F1 X% Oh代表html7 v/ }- ]  H) N8 I" u1 e  z
    Stardict editor assumes the input and therefore output is plain text.& j) [5 P8 x, S. }
    Just open your .ifo file and change sametypesequence=m to sametypesequence=h
    5 ~7 x9 v) M  b- Y5 V4 Z3 hThen reindex the dictionary in GoldenDict.
    + }7 N0 W& J- I3 b' B
    / V2 @- V/ F7 u% X! k  d$ K1 mFor 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
    3 m" n! s0 G7 J5 V3 n% K$ o打开.ifo文件将里面的sametypesequence=m改为 sametypesequence=h9 C7 `4 I+ n5 w& y7 O. `0 u3 T
    h代表html

    6 e2 T% B$ ^; T/ f/ S! d非常感谢您!9 ^$ c9 Z. H7 S/ ^2 r, H

    7 i, O& [. G! {搞好了,多谢!
    , o3 _& j) f) B9 n/ Q, R, d. J+ j
    您需要登录后才可以回帖 登录 | 免费注册

    本版积分规则

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

    GMT+8, 2025-6-27 18:14 , Processed in 0.023450 second(s), 22 queries .

    Powered by Discuz! X3.4

    © 2001-2023 Discuz! Team.

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