编译安装 GoldenDict

GoldenDict 是 linux 上最流行的字典软件。

可以通过编译源码安装:

Open terminal, then make sample work folder and grab Golden Dict source:

git clone https://github.com/goldendict/goldendict.git

Goto cloned folder: cd goldendict

Unlike common use, file configure lists which packages are needed for building Golden Dict. Get them withapt-get:

sudo apt-get install libvorbis-dev zlib1g-dev libhunspell-dev x11proto-record-dev qt4-qmake libqt4-dev g++ libxtst-dev libphonon-dev

Now run: qmake and then make

如果遇到问题:

1. decompress.cc:5:19: fatal error: bzlib.h: No such file or directory
需要安装 libbz2-dev

(http://askubuntu.com/questions/125326/i-can-not-see-images-in-goldendict)

2. In file included from mainwindow.cc:5:0:
epwing_book.hh:21:19: fatal error: eb/eb.h: No such file or directory
需要安装 libeb-dev package 或者: qmake CONFIG+=no_epwing_support

这几天在网上陆续找到了 Longman, Oxford, Merrian Webster 的词典,包括有发音和图片,共有几个 G大小。

这些 dsl 格式的词典,需要配置一下才能在 goldenDict 上使用下面以 longman 词典为例说一下如何配置:

1. 建立一个名为longman5的目录,先把主词典文件En-En-LongmanDOCE5.03-06-2009.dsl.rar解压到该目录,得到3个文件En-En-Longman_DOCE5.ann,En-En-Longman_DOCE5.bmp 和 En-En-Longman_DOCE5.dsl。

2. 用dictzip压缩主词典En-En-Longman_DOCE5.dsl。

命令: dictzip  En-En-Longman_DOCE5.dsl

得到Goldendict支持的词典格式En-En-Longman_DOCE5.dsl.dz。

3. 新建一个临时目录tmp,把下载的其它5个RAR文件全部解压到该目录下。注意要使用命令来完成,因为这一步将产生十几万个文件,用图形界面的话会长时间无响应。

4. 将tmp下的所有文件(不分层次)用ZIP压缩,使用命令:

  find . -name "*" -print | zip -9 ../En-En-Longman_DOCE5.dsl.dz.files.zip -@

  照抄这个命令就行了,也许你想到了使用通配符来引用全部文件,简单方便,恭喜你,想法是好的,但在这里行不通,因为文件数量太大。压缩完得到文件En-En-Longman_DOCE5.dsl.dz.files.zip,大约1.3G左右。

 5. 到这里基本算是完成了。确认经过以上4步后以下4个文件都在目录longman5下,而且文件名不能乱改,否则无法识别。

    En-En-Longman_DOCE5.ann
    En-En-Longman_DOCE5.bmp
    En-En-Longman_DOCE5.dsl.dz
    En-En-Longman_DOCE5.dsl.dz.files.zip

 6.打开Goldendict,选择菜单Edit /Dictionaries, 将longman5这个目录添加到词典来源就行了。



评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值