Linux下安装有道词典

来源:互联网 发布:java aop自定义 编辑:程序博客网 时间:2024/05/16 00:27

        安装环境:Ubuntu32位操作系统

        参考网址:http://www.bc-sj.com/html/linux/rumen/ruanjianshiyong/2011/0201/2222.html

        1,下载有道安装包pyton-dict.1.0.1.zip,网址:http://sourceforge.net/projects/yodao-free/files/python-dict/ ,下载后解压得到的文件夹中有一个dict.py的文件,将其复制到home文件夹下或者进入其所在文件夹下,然后在终端执行命令python dict.py + 你要搜索的词,就可以看到解释了,如下:

alice@alice-Aspire-4738G:~$ python dict.py chinese
chinese
Translations from 有道词典
n. 中文,汉语;中国人
adj. 中国的,中国人的;中国话的
Translations from WordNet
any of the Sino-Tibetan languages spoken in China; regarded as dialects of a single language (even though they are mutually unintelligible) because they share an ideographic writing system
a native or inhabitant of Communist China or of Nationalist China
of or pertaining to China or its peoples or cultures
of or relating to or characteristic of the island republic on Taiwan or its residents or their language
Translations from yodao:
Chinese:    汉语
Chinese Taipei:    中华台北

        2,自定义命令alias,如果你觉得麻烦,可以自定义命令,比如 ll 命令就是“ls -al”的缩写,它是通过alias ll = "ls -al"来实现的。这里如果想要在终端下输入 youdao + 单词 就能获得解释那么你可以在命令行下执行alias youdao="python dict.py" ,然后source .bashrc使其生效,接下来执行 youdao + 单词,你就能看到单词的释义啦!




原创粉丝点击