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

Last change on this file since 21 was 21, checked in by manerakai, 22 months ago

Implemented Definitions and Translations for google

File size: 741 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 InternalName() string
12 DisplayName() string
[15]13 SourceLanguages() (Language, error)
14 TargetLanguages() (Language, error)
15 Translate(text string, from, to string) (TranslationResult, error)
16 DetectLanguage(text string) (string, error)
[20]17 Tts(text, lang string) (string, error)
[9]18}
[15]19
20type Language map[string]string
21
22var Engines = map[string]Engine{
[20]23 "google": &GoogleTranslate{},
24 // "icibia": &ICIBA{},
25 // "libre": &LibreTranslate{},
[15]26 "reverseo": &Reverso{},
27}
Note: See TracBrowser for help on using the repository browser.