Documentation ¶
Overview ¶
Chinese-English dictionary database search functions
Package for looking up words and multiword expressions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Searcher ¶ added in v0.0.5
type Searcher struct {
// contains filtered or unexported fields
}
Searcher looks up Chinese words by either Chinese or English.
If the dictionary searcher cannot connect to the database then it will run in degraded mode by looking up Chinese words form dictionary file.
func NewSearcher ¶ added in v0.0.5
NewSearcher initialize SQL statements
func (*Searcher) FindWordsByEnglish ¶ added in v0.0.5
func (searcher *Searcher) FindWordsByEnglish(ctx context.Context, query string) ([]dicttypes.WordSense, error)
FindWordsByEnglish returns the word senses with English approximate or Pinyin exact match
func (*Searcher) Initialized ¶ added in v0.0.17
Initialized returns true if there were no error in initialization.
type Validator ¶ added in v0.0.18
Performs validation of dictionary entries. Use NewValidator to create a Validator.
func NewValidator ¶ added in v0.0.18
Crates a Validator with the given readers Params:
posReader Reader to load the valid parts of speech from domainReader Reader to load the valid subject domains
Returns:
An initialized Validator