Documentation ¶
Index ¶
- Variables
- type Node
- type Tried
- func (tried *Tried) Get(words string) interface{}
- func (tried *Tried) Has(words string) bool
- func (tried *Tried) HasPrefix(words string) bool
- func (tried *Tried) PrefixWords(words string) []string
- func (tried *Tried) Put(words string)
- func (tried *Tried) PutWithValue(words string, value interface{})
- func (tried *Tried) String() string
- func (tried *Tried) Traversal(every func(cidx uint, value interface{}) bool)
- func (tried *Tried) WordsArray() []string
- type WordIndexType
Constants ¶
This section is empty.
Variables ¶
View Source
var WordIndexDict map[WordIndexType]*wordIndexStore
Functions ¶
This section is empty.
Types ¶
type Tried ¶
type Tried struct {
// contains filtered or unexported fields
}
func NewWithWordType ¶
func NewWithWordType(t WordIndexType) *Tried
NewWithWordType 选择单词的类型 WordIndexLower 意味着只支持小写
func (*Tried) PrefixWords ¶
func (*Tried) PutWithValue ¶ added in v0.11.3
PutWithValue the word with value in tried.eg. you can count word in value
func (*Tried) WordsArray ¶
type WordIndexType ¶
type WordIndexType int
WordIndexType 单词统计的类型 eg. WordIndexLower 意味Put的单词只支持小写...
const ( // WordIndexLower 小写 WordIndexLower WordIndexType // WordIndexUpper 大写 WordIndexUpper // WordIndexDigital 数字 WordIndexDigital // WordIndexUpperLower 大+小写 WordIndexUpperLower // WordIndexLowerDigital 小写+数字 WordIndexLowerDigital // WordIndexUpperDigital 大写+数字 WordIndexUpperDigital // WordIndexUpperLowerDigital 大小写+数字 WordIndexUpperLowerDigital // WordIndex256 256个字符 0-255 ascii WordIndex256 // WordIndex32to126 32-126 ascii WordIndex32to126 )
Click to show internal directories.
Click to hide internal directories.