Documentation ¶
Index ¶
- Variables
- type Dat
- func (d *Dat) Analysis(sentence string) (keys []string, indexes []int)
- func (d *Dat) DumpToFile(filePath string) error
- func (d *Dat) Hollow() int
- func (d *Dat) KeySize() int
- func (d *Dat) MatchPrefix(word string) bool
- func (d *Dat) Matches(word string) bool
- func (d *Dat) MatchesIndex(s string) int
- func (d *Dat) ObtainPrefixes(word string) (res []string)
- func (d *Dat) Size() int
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // MinExpansiveFactor 适配 state 时,数组最小扩容系数。如果同层子节点 code 相差大,则该值该调大。 MinExpansiveFactor = 1.2 // InitArrayFactor 初始扩容系数。 InitArrayFactor = 2.5 )
Functions ¶
This section is empty.
Types ¶
type Dat ¶ added in v1.2.0
type Dat struct {
// contains filtered or unexported fields
}
func (*Dat) DumpToFile ¶ added in v1.2.0
DumpToFile 备份树。
func (*Dat) MatchPrefix ¶ added in v1.2.0
MatchPrefix 判断 word 是否匹配词库中任何一个词的前缀。
func (*Dat) MatchesIndex ¶ added in v1.2.0
MatchesIndex 查找 s 在树中索引,不存在返回-1。
func (*Dat) ObtainPrefixes ¶ added in v1.2.0
ObtainPrefixes 返回所有匹配 word 前缀的词。
Click to show internal directories.
Click to hide internal directories.