node-dictionary
Installation
Prerequisity: Node.js (>=6.x)
$ npm install -g node-dictionary
Usage
Usage: dict <command> [options]Commands:query|q <word> query word by youdao dictionarytrans|t <text> translate text by baidu translatorlangs|l [from] [to] toggle translator, default from [auto] to [zh]show|s [options] show current or all translatorhelp [cmd] display help for [cmd]Options:-h, --help output usage information-V, --version output the version number
Example
Query word
$ dict query apple英 ['æp(ə)l] 美 ['æpl]n. 苹果,苹果树,苹果似的东西;[美俚]炸弹,手榴弹,(棒球的)球;[美俚]人,家伙。网络释义APPLE 苹果,苹果,苹果公司Apple Lossless Apple Lossless,Apple Lossless,애플 무손실Apple Store 苹果商店,苹果零售店,苹果商店Powered by Youdao
Translate text
$ dict trans Apple is not an appleEnglish 英语 => Chinese 中文Apple is not an apple => 苹果不是一个苹果Powered by Baidu
Support
Youdao
Query byOnly English-Chinese or Chinese-English querying support.
Baidu
Translator byBaidu translator support 27 kinds of languages.
Check languages table and choose two abbreviations via:
$ dict langs zh jp
Attention
- The target language cannot be auto.
- Cannot be same languages.
- In order to ensure the quality of the translation, please control the number of words.
Languages table
Abbr | Language | 语言 |
---|---|---|
auto | Auto | 自动检测 |
zh | Chinese | 中文 |
en | English | 英语 |
yue | Cantonese | 粤语 |
wyw | Classical Chinese | 文言文 |
jp | Japanese | 日语 |
kor | Korean | 韩语 |
fra | French | 法语 |
spa | Spanish | 西班牙语 |
th | Thai | 泰语 |
ara | Arabic | 阿拉伯语 |
ru | Russian | 俄语 |
pt | Potuguese | 葡萄牙语 |
de | German | 德语 |
it | Italian | 意大利语 |
el | Greek | 希腊语 |
nl | Ductch | 荷兰语 |
pl | Polish | 波兰语 |
bul | Bulgarian | 保加利亚语 |
est | Estonian | 爱沙尼亚语 |
dan | Danish | 丹麦语 |
fin | Finnish | 芬兰语 |
cs | Czech | 捷克语 |
rom | Romanian | 罗马尼亚语 |
slo | Slovenian | 斯洛文尼亚语 |
swe | Swedish | 瑞典语 |
hu | Hungarian | 匈牙利语 |
cht | Traditional Chinese | 繁体中文 |