engine

package
v0.0.0-...-0afd1eb Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine interface {
	URL(q Query) string
	Execute(q Query) Result
}

Engine interface

func NewEngine

func NewEngine(e string) Engine

NewEngine creates and returns a engine implementation of type specified

type GoogleEngine

type GoogleEngine struct {
}

GoogleEngine for google

func (GoogleEngine) Execute

func (e GoogleEngine) Execute(q Query) (result Result)

Execute the query

func (GoogleEngine) URL

func (e GoogleEngine) URL(q Query) string

URL implementation

type Pronounce

type Pronounce struct {
	Name     string
	Phonetic string
}

Pronounce structure

func (Pronounce) String

func (p Pronounce) String() string

type Query

type Query struct {
	Words    []string
	Lang     string
	WebTrans bool
}

Query represent a word query

type Result

type Result struct {
	Title         string
	PronounceList []Pronounce
	Translates    []string
	WebTranslates []string
	WebPhrases    []string
	Origin        string
}

Result of query the dictionary

func (Result) String

func (r Result) String() string

type YDEngine

type YDEngine struct {
}

YDEngine for youdao dictionary

func (YDEngine) Execute

func (e YDEngine) Execute(q Query) (result Result)

Execute the query

func (YDEngine) URL

func (e YDEngine) URL(q Query) string

URL implementation

Jump to

Keyboard shortcuts

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