YtAPIGo
It is a program to translate and check spelling using the console, it 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:
make build
./yg -h
Usage of ./yg:
-c string
configuration file (default "$HOME/.ytapigo3/config.json")
-d debug mode
-g string
translation languages direction (empty - auto en/ru, ru/en, "auto" - detected lang to ru)
-r reset cache
-t duration
timeout for request (default 5s)
-v print version
Usage:
./yg -g en-fr Hello dear fried!
Spelling:
fried -> [friend friends fred]
Bonjour chère fried!
./yg lion
lion [ˈlaɪən] (noun)
лев (noun)
syn: львица (noun), львенок (noun)
mean: lev, lioness, cub
lion [ˈlaɪən] (adjective)
львиный (adjective)
./yg лев
лев(noun)
lion (noun)
Lev (noun)
syn: Leo (noun)
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 $HOME/.ytapigo2/config.json (example cfg.example.json).
{
"user_agent": "ytapigo/3.0",
"proxy_url": "proxy like https://user:password@host:port",
"dictionary": "API dictionary key",
"auth_cache": "path to local token credentials JSON cache file, no cache if empty",
"debug": true,
"translation": {
"folder_id": "API translation folder ID",
"key_id": "API key ID",
"service_account_id": "API service account ID",
"key_file": "path to local auth PEM file"
}
}
- translation - documentation Yandex Translate
- 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.