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

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