source: code/trunk/engines/engine.go@ 50

Last change on this file since 50 was 48, checked in by yakumo.izuru, 20 months ago

Reorganized the codebase, add support for flag modus operandi

Signed-off-by: Izuru Yakumo <yakumo.izuru@…>

File size: 669 bytes
RevLine 
[9]1package engines
2
3type TranslationResult struct {
[21]4 SourceLanguage string `json:"source_language"`
5 Definitions interface{} `json:"definitions"`
6 Translations interface{} `json:"translations"`
7 TranslatedText string `json:"translated_text"`
[9]8}
9
[10]10type Engine interface {
[9]11 DisplayName() string
[15]12 SourceLanguages() (Language, error)
13 TargetLanguages() (Language, error)
14 Translate(text string, from, to string) (TranslationResult, error)
[20]15 Tts(text, lang string) (string, error)
[9]16}
[15]17
18type Language map[string]string
19
20var Engines = map[string]Engine{
[20]21 "google": &GoogleTranslate{},
[48]22 // "iciba": &ICIBA{},
23 // "libre": &LibreTranslate{},
[27]24 "reverso": &Reverso{},
[15]25}
Note: See TracBrowser for help on using the repository browser.