qhwa / Command-Line-Youdao-Dictionary

在命令行中查单词,使用网易有道词典

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

有道词典命令行版

这是一个ruby脚本,用来在命令行中直接查询单词含义,免去打开软件或浏览器的麻烦。 支持英译中、中译英。

安装

# 你可能需要一个代理服务器
wget https://raw.githubusercontent.com/qhwa/Command-Line-Youdao-Dictionary/master/dict
chmod a+x dict
mv dict /usr/local/bin/dict # 如果希望全局可以使用

可选: 发音功能需要安装 mpg123
(可以通过 homebrew, apt-get 等包管理工具安装)

使用方法

  1. 简单用法

    dict <要查询的单词>

    例如:

    dict cake
    dict 蛋糕
  2. 发音

    英文的单词和词组可以发音,支持美式/英式发音。 如需发音,需要先安装 mpg123

    dict -v give birth to
    # 英式发音 (default)
    dict -v -a 1 microscope
    
    # 美式发音
    dict -v -a 2 microscope
  3. 完整命令行参数

    dict <word> [options]
        -v, --voice         play voice
        -a, --accent=acent  accent of voice, can either be `1` (UK) or `2` (US)

demo

About

在命令行中查单词,使用网易有道词典


Languages

Language:Ruby 100.0%