项目作者: z0rr0

项目描述 :
Console translator and speller
高级语言: Go
项目地址: git://github.com/z0rr0/ytapigo.git
创建时间: 2014-12-28T15:57:43Z
项目社区:https://github.com/z0rr0/ytapigo

开源协议:BSD 3-Clause "New" or "Revised" License

下载


YtAPIGo

GoDoc
Go
Version
License

It is a program to translate and check spelling using the console,
it’s based on Yandex Translate API.
By default, UTF-8 encoding is used.

A spell check is supported only for English, Russian and Ukrainian languages.

Usage

Build binary file yg:

  1. make build
  2. ./yg -h
  3. Usage of ./yg:
  4. -c string
  5. configuration file (default "<USER_CONFIG_DIR>/ytapigo/config.json")
  6. -d debug mode
  7. -g string
  8. translation languages direction (empty - auto en/ru, ru/en, "auto" - detected lang to ru)
  9. -r reset cache
  10. -t duration
  11. timeout for requests (default 5s)
  12. -v print version

Usage:

  1. ./yg -g en-fr Hello dear fried!
  2. Spelling:
  3. fried -> [friend friends fred]
  4. Bonjour chère fried!
  5. ./yg lion
  6. lion laɪən] (noun)
  7. лев (noun)
  8. syn: львица (noun), львенок (noun)
  9. mean: lev, lioness, cub
  10. lion laɪən] (adjective)
  11. львиный (adjective)
  12. ./yg лев
  13. лев(noun)
  14. lion (noun)
  15. Lev (noun)
  16. syn: Leo (noun)
  17. mean: лео

API keys

API keys are required for using Yandex Translate API.

Users should get API keys before ytapigo using (see links below).
By default, configuration file will be searched in user config directory.
(example cfg.example.json).

  1. {
  2. "user_agent": "ytapigo/3.0",
  3. "proxy_url": "proxy like https://user:password@host:port",
  4. "dictionary": "API dictionary key",
  5. "auth_cache": "path to local token credentials JSON cache file, no cache if empty",
  6. "debug": true,
  7. "translation": {
  8. "folder_id": "API translation folder ID",
  9. "key_id": "API key ID",
  10. "service_account_id": "API service account ID",
  11. "key_file": "path to local auth PEM file"
  12. }
  13. }
  1. translation - documentation Yandex Translate
  2. dictionary - documentation Yandex Dictionary

Also it uses Yandex Speller.

License

This source code is governed by a BSD license
that can be found in the LICENSE file.