Documentation ¶
Index ¶
Constants ¶
View Source
const ( Youdao = "Youdao" Baidu = "Baidu" )
单词来源
View Source
const ( Online = FromStorage(iota) MemCache )
FromStorage
View Source
const (
CacheCapacity = 10
)
View Source
const (
EnvTermDictRootKey = "TERMDICT_DIR"
)
View Source
const (
Verb = iota
)
词性,暂时不用
Variables ¶
View Source
var ( // 是否显示例句来源 OptShowExampleSrc = false // 是否显示查询结果的来源 OptShowResultSrc = true // 词性和解释是否分行显示 // true : <pos> <trans> // false: - 词性: <pos> // 释义: <trans> OptSeparatePosAndTrans = false )
View Source
var ( EnvTermDictRoot string = "~/TermdictCache/" EnvTermDictCache string )
View Source
var (
RegexCacheFileName, _ = regexp.Compile(`\w+`)
)
Functions ¶
func Initialize ¶
func Initialize()
Types ¶
type Example ¶
type Example struct { Sentence string `yaml:"英"` Translation string `yaml:"中"` From ExampleSrc `yaml:"源,omitempty"` }
例句,包括英文、中文以及例句出处
type ExampleSrc ¶
type ExampleSrc string
func (ExampleSrc) IsZero ¶
func (f ExampleSrc) IsZero() bool
type FromStorage ¶
type FromStorage int
存储位置
func (FromStorage) IsZero ¶
func (w FromStorage) IsZero() bool
type Translation ¶
type Translation struct { //词性 position of speech POS string `yaml:"词性,omitempty"` //目标语言释义 Trans string `yaml:"释"` }
func (Translation) String ¶
func (t Translation) String() string
type Word ¶
type Word struct { Spell string `yaml:"单词"` Trans []Translation `yaml:"解释"` Pronounce []Pronunciation `yaml:"发音,omitempty,flow"` Examples []Example `yaml:"例句,omitempty"` Source WordSrc `yaml:"来源,omitempty"` From FromStorage `yaml:"存储位置,omitempty"` }
单词
Click to show internal directories.
Click to hide internal directories.