Giter Site home page Giter Site logo

youdao-go's Introduction

Golang 有道词典命令行版 License: MIT

Golang 编写的有道词典命令行版本,支持单词或句子中英互译。Python 版

一直觉得 Python 写一些命令行脚本还算方便,直到我知道了 go build....

构建

获取源码

$ git clone https://github.com/chenjiandongx/youdao-go.git

编译

  • Windows
$ go get
$ go build -ldflags "-s -w" -o yd.exe cli.go core.go
  • Linux/MacOS
$ go get
$ go build -ldflags "-s -w" -o yd cli.go core.go

upx 压缩可执行文件

$ upx yd    # windows 则为 upx yd.exe

使用

$ yd --help
yd <words> [options]

Query words meanings via the command line.

Example:
  words could be word or sentence.

  yd hello
  yd php is the best language in the world
  yd 你好

Usage:
  yd <words>...
  yd -h | --help
  yd -v | --version

Options:
  -h --help         show this help message and exit.
  -v  --version     displays the current version of youdao-go.

查询单词

$ yd coder
>>  coder: 编码器

    美:['kəudə]  英:['kəʊdə]

    n. 编码器;编码员
    n. (Coder)人名;(法)科代;(英、葡)科德尔

    coder[编码员 编码器 程序员]
    speech coder[语言编码器 音频编码器 语音编码器]
    incremental coder[增量编码器]

查询句子

$ yd talk is cheap, show me the code
>>  talk is cheap, show me the code: 说说很简单,给我代码

中文翻译

$ yd php是世界上最好的语言
>>  php是世界上最好的语言: PHP is one of the best language in the world

LICENSE

MIT ©chenjiandongx

youdao-go's People

Contributors

chenjiandongx avatar fwindpeak avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.