Documentation
¶
Index ¶
- Variables
- func QueryBD(word, transLang string) (string, map[string]string, error)
- func QueryCY(word, transType string) (string, map[string]string, error)
- func QueryHS(word, srcLang, tarLang string) (string, map[string]string, error)
- func Translate(text string, from language.Tag, to language.Tag, googleHost ...string) (string, error)
- func TranslateWithParams(text string, params TranslationParams) (string, error)
- type DictRequestCY
- type DictRequestHS
- type DictResponseBD
- type DictResponseCY
- type DictResponseHS
- type DictResponseHSData
- type TranslationParams
Constants ¶
This section is empty.
Variables ¶
View Source
var GoogleHost = "google.com"
Functions ¶
func Translate ¶
func Translate(text string, from language.Tag, to language.Tag, googleHost ...string) (string, error)
Translate translate a text using native tags offer by go language
func TranslateWithParams ¶
func TranslateWithParams(text string, params TranslationParams) (string, error)
TranslateWithParams translate a text with simple params as string
Types ¶
type DictRequestCY ¶
type DictRequestHS ¶
type DictResponseBD ¶
type DictResponseCY ¶
type DictResponseCY struct {
Rc int `json:"rc"`
Wiki struct {
KnownInLaguages int `json:"known_in_laguages"`
Description struct {
Source string `json:"source"`
Target interface{} `json:"target"`
} `json:"description"`
ID string `json:"id"`
Item struct {
Source string `json:"source"`
Target string `json:"target"`
} `json:"item"`
ImageURL string `json:"image_url"`
IsSubject string `json:"is_subject"`
Sitelink string `json:"sitelink"`
} `json:"wiki"`
Dictionary struct {
Prons struct {
EnUs string `json:"en-us"`
En string `json:"en"`
} `json:"prons"`
Explanations []string `json:"explanations"`
Synonym []string `json:"synonym"`
Antonym []string `json:"antonym"`
WqxExample [][]string `json:"wqx_example"`
Entry string `json:"entry"`
Type string `json:"type"`
Related []interface{} `json:"related"`
Source string `json:"source"`
} `json:"dictionary"`
}
type DictResponseHS ¶
type DictResponseHSData ¶
Click to show internal directories.
Click to hide internal directories.