Documentation ¶
Index ¶
- Constants
- func DetectUrl(key string) *url.URL
- func LanguagesUrl(target, model, key string) *url.URL
- func NewTranslator(hc *http.Client, model, key string) (polyglot.Translator, error)
- func TranslateUrl(key string) *url.URL
- type DetectLanguageResponseList
- type DetectRequest
- type DetectResponse
- type DetectionsListValue
- type GetLanguagesResponse
- type GetSupportedLanguagesResponseLanguage
- type GetSupportedLanguagesResponseList
- type TranslateRequest
- type TranslateResponse
- type TranslateTextResponseList
- type TranslateTextResponseTranslation
- type Translator
- func (t *Translator) Detect(content string) (string, error)
- func (t *Translator) IsHTMLSupported() bool
- func (t *Translator) Languages(language string) (map[string]string, error)
- func (t *Translator) Translate(source, target string, format polyglot.TranslateFormat, query ...string) ([]string, error)
Constants ¶
View Source
const (
NeuralMachineTranslation = "nmt"
)
Variables ¶
This section is empty.
Functions ¶
func LanguagesUrl ¶
func NewTranslator ¶ added in v0.1.1
func TranslateUrl ¶
Types ¶
type DetectLanguageResponseList ¶ added in v0.1.1
type DetectLanguageResponseList struct {
Detections [][]DetectionsListValue `json:"detections"`
}
type DetectRequest ¶ added in v0.1.1
type DetectRequest struct {
Query string `json:"q"`
}
type DetectResponse ¶ added in v0.1.1
type DetectResponse struct {
Data DetectLanguageResponseList `json:"data"`
}
type DetectionsListValue ¶ added in v0.1.1
type GetLanguagesResponse ¶ added in v0.1.1
type GetLanguagesResponse struct {
Data GetSupportedLanguagesResponseList `json:"data"`
}
type GetSupportedLanguagesResponseLanguage ¶ added in v0.1.1
type GetSupportedLanguagesResponseList ¶ added in v0.1.1
type GetSupportedLanguagesResponseList struct {
Languages []GetSupportedLanguagesResponseLanguage `json:"languages"`
}
type TranslateRequest ¶ added in v0.1.1
type TranslateResponse ¶ added in v0.1.1
type TranslateResponse struct {
Data TranslateTextResponseList `json:"data"`
}
type TranslateTextResponseList ¶ added in v0.1.1
type TranslateTextResponseList struct {
Translations []TranslateTextResponseTranslation `json:"translations"`
}
type TranslateTextResponseTranslation ¶ added in v0.1.1
type Translator ¶ added in v0.1.1
type Translator struct {
// contains filtered or unexported fields
}
func (*Translator) Detect ¶ added in v0.1.1
func (t *Translator) Detect(content string) (string, error)
func (*Translator) IsHTMLSupported ¶ added in v0.1.1
func (t *Translator) IsHTMLSupported() bool
func (*Translator) Languages ¶ added in v0.1.1
func (t *Translator) Languages(language string) (map[string]string, error)
func (*Translator) Translate ¶ added in v0.1.1
func (t *Translator) Translate(source, target string, format polyglot.TranslateFormat, query ...string) ([]string, error)
Click to show internal directories.
Click to hide internal directories.