dict

package
v0.0.0-...-ea46cf4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 25, 2015 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IcibaEngine  = "iciba"
	YoudaoEngine = "youdao"
)
View Source
const (
	Iciba_KEY = "D191EBD014295E913574E1EAF8E06666"
	Iciba_URL = "http://dict-co.iciba.com/api/dictionary.php?key=%s&w=%s"
)
View Source
const (
	API_FROM = "YouDaoCV"
	API_KEY  = "659600698"
	API_URL  = "http://fanyi.youdao.com/openapi.do?keyfrom=%s&key=%s&type=data&doctype=json&version=1.1&q=%s"
)
View Source
const (
	Version = "v0.1"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicTrans

type BasicTrans struct {
	Us_phonetic string   `json:"us-phonetic"`
	Phonetic    string   `json:"phonetic"`
	Uk_phonetic string   `json:"uk-phonetic"`
	Explains    []string `json:"explains"`
}

type Dict

type Dict interface {
	Translate(word string)
}

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

func NewEngine

func NewEngine(name string) *Engine

func (*Engine) ReNew

func (e *Engine) ReNew(name string)

func (*Engine) Translate

func (e *Engine) Translate(word string)

type Iciba

type Iciba struct {
}

func NewIciba

func NewIciba() *Iciba

func (*Iciba) Translate

func (this *Iciba) Translate(word string)

type IcibaTran

type IcibaTran struct {
	Key         string   `xml:"key"`
	Ps          []string `xml:"ps"`
	Pron        []string `xml:"pron"`
	Pos         []string `xml:"pos"`
	Acceptation []string `xml:"acceptation"`
	Sent        []Sent   `xml:"sent"`
}

type Sent

type Sent struct {
	Orig  string `xml:"orig"`
	Trans string `xml:"trans"`
}

type WebTrans

type WebTrans struct {
	Key   string   `json:"key"`
	Value []string `json:"value"`
}

type Youdao

type Youdao struct {
}

func NewYoudao

func NewYoudao() *Youdao

func (*Youdao) Translate

func (this *Youdao) Translate(word string)

type YoudaoTran

type YoudaoTran struct {
	Translation []string   `json:"translation"`
	Basic       BasicTrans `json:"basic"`
	Query       string     `json:"query"`
	ErrorCode   int        `json:"errorCode"`
	Web         []WebTrans `json:"web"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL