Dig is a command-line program which now communicates with google/youdao translation server. It can be used for look up the words or sentences through google/youdao translation server.
Usage: dig [-f <from_lang>] [-t <to_lang>]
[-v|--reverse] [-s|--speak] <data>...
dig [-n <num>] -r|--record
dig -c|--configure <tool>
dig -h|--help
Options:
-f <from_lang> input language [default: en]
-t <to_lang> ouput language [default: zh_CN]
-v --reverse reverse -f and -t
-s --speak speak out the result
-n <num> display n records [default: 0(That means all record)]
-r --record display search record
-c --configure set current translation tool [google,youdao]
-h --help ask for detailed help
Examples:
$ dig -c
----- Your current translation tool: youdao -----
[warning]...
$ dig -c google
----- Your current translation tool: youdao -----
Change to google successfully!
$ dig -f en -t zh_CN hello
source lang: en ----> target lang: zh_CN
您好 你好 打招呼 招呼 问好
$ dig hello
source lang: en ----> target lang: zh_CN
您好 你好 打招呼 招呼 问好
$ dig -v 你好
source lang: zh_CN ----> target lang: en
Hello
$ dig Life is short,I use python.
人生苦短,我使用Python。
$ dig -t ja hello
こんにちは ハロー のhello ようこそ
$ dig -r
===========================================
time:08/17/15 20:41:24
from_lang:ento_lang:zh_CN
data:hello
result:您好 你好 打招呼 招呼 问好
===========================================
$ dig -s hello
source lang: en ----> target lang: zh_CN
您好 你好 打招呼 招呼 问好
Listening...
More..........dig --help................
- English : en
- Chinese : zh_CN
- Japanese : ja
- ...
- English : EN
- Chinese : ZH_CN
- Japanese : JA
- ...
- Docopt v0.6.2 is adopt for parsing arguments.
- Works on Linux, Windows, BSD
- futures v3.0.3 is adopt for concurrence and compatibility.
- Docopt v0.6.2 is adopt for parsing arguments.
- Works on Linux, Windows, BSD
$ pip install dig
See https://pypi.python.org/pypi/dig
Note:
In the way "pkg_resources.distributionnotfound:requests" maybe happen, just remove site-packages/requests, download requests and install.
download the whole package and input as follows:
$ python setup.py install
You can download the latest stable and development releases from: https://github.com/enjoyhot/dig/releases
v0.1.10
Bugfixes
- TTS fits for Windows7 or Linux platform.
v0.1.9
Bugfixes
- Update the dig for global Environment in windows dos or linux shell.
- You should install mpg123 if your platform is Linux.
- Now only support google and youdao translation, make sure your computer can connect to google.com or youdao.com.
Only for Win7: There was wrong when piping for requests packages, so download it individually.