Documentation ¶
Index ¶
- Variables
- type Engine
- type GoogleTranslate
- func (_ *GoogleTranslate) DisplayName() string
- func (e *GoogleTranslate) SourceLanguages() (Language, error)
- func (e *GoogleTranslate) TargetLanguages() (Language, error)
- func (_ *GoogleTranslate) Translate(text string, from, to string) (TranslationResult, error)
- func (e *GoogleTranslate) Tts(text, lang string) (string, error)
- type ICIBA
- type Language
- type LibreTranslate
- func (_ *LibreTranslate) DisplayName() string
- func (e *LibreTranslate) SourceLanguages() (Language, error)
- func (e *LibreTranslate) TargetLanguages() (Language, error)
- func (e *LibreTranslate) Translate(text string, from, to string) (TranslationResult, error)
- func (e *LibreTranslate) Tts(text, lang string) (string, error)
- type Reverso
- type TranslationResult
Constants ¶
This section is empty.
Variables ¶
View Source
var Engines = map[string]Engine{ "google": &GoogleTranslate{}, "reverso": &Reverso{}, }
Functions ¶
This section is empty.
Types ¶
type GoogleTranslate ¶
type GoogleTranslate struct{}
func (*GoogleTranslate) DisplayName ¶
func (_ *GoogleTranslate) DisplayName() string
func (*GoogleTranslate) SourceLanguages ¶
func (e *GoogleTranslate) SourceLanguages() (Language, error)
func (*GoogleTranslate) TargetLanguages ¶
func (e *GoogleTranslate) TargetLanguages() (Language, error)
func (*GoogleTranslate) Translate ¶
func (_ *GoogleTranslate) Translate(text string, from, to string) (TranslationResult, error)
type ICIBA ¶
type ICIBA struct{}
ICIBA is an engine that fetches data from https://www.iciba.com.
func (*ICIBA) DisplayName ¶
func (*ICIBA) SourceLanguages ¶
func (*ICIBA) TargetLanguages ¶
type LibreTranslate ¶
type LibreTranslate struct { // InstanceURL is the URL to a LibreTranslate instance, for example // "https://libretranslate.com". InstanceURL string // APIKey is the API key for the given instance. If empty, then no API // key will be sent along with requests to the instance. // // Some instances issue API keys to users so that they can have a // higher rate limit. See // https://github.com/LibreTranslate/LibreTranslate#manage-api-keys for // more information. APIKey string }
LibreTranslate is an engine that interfaces with any LibreTranslate(https://github.com/LibreTranslate/LibreTranslate) instance.
func (*LibreTranslate) DisplayName ¶
func (_ *LibreTranslate) DisplayName() string
func (*LibreTranslate) SourceLanguages ¶
func (e *LibreTranslate) SourceLanguages() (Language, error)
func (*LibreTranslate) TargetLanguages ¶
func (e *LibreTranslate) TargetLanguages() (Language, error)
func (*LibreTranslate) Translate ¶
func (e *LibreTranslate) Translate(text string, from, to string) (TranslationResult, error)
type Reverso ¶
type Reverso struct{}
Reverso is an engine that fetches data from https://reverso.net.
func (*Reverso) DisplayName ¶
func (*Reverso) SourceLanguages ¶
func (*Reverso) TargetLanguages ¶
type TranslationResult ¶
Click to show internal directories.
Click to hide internal directories.