Documentation
¶
Index ¶
- Constants
- Variables
- type BuildOption
- type CacheLevel
- type Keyset
- type LookupCallback
- type NodeOrder
- type TailMode
- type Trie
- func (t *Trie) CommonPrefixSearch(str string, callback LookupCallback) error
- func (t *Trie) Dispose()
- func (t *Trie) IoSize() (uint64, error)
- func (t *Trie) Lookup(str string) (uint64, error)
- func (t *Trie) NumKeys() (uint64, error)
- func (t *Trie) NumNodes() (uint64, error)
- func (t *Trie) NumTries() (uint64, error)
- func (t *Trie) PredictiveSearch(str string, callback LookupCallback) error
- func (t *Trie) ReverseLookup(id uint64) (string, error)
- func (t *Trie) Save(file string) error
- func (t *Trie) Size() (uint64, error)
- func (t *Trie) TotalSize() (uint64, error)
Constants ¶
View Source
const ( MARISA_MIN_NUM_TRIES = C.MARISA_MIN_NUM_TRIES MARISA_MAX_NUM_TRIES = C.MARISA_MAX_NUM_TRIES MARISA_DEFAULT_NUM_TRIES = C.MARISA_DEFAULT_NUM_TRIES )
View Source
const ( MARISA_HUGE_CACHE CacheLevel = C.MARISA_HUGE_CACHE MARISA_LARGE_CACHE = C.MARISA_LARGE_CACHE MARISA_NORMAL_CACHE = C.MARISA_NORMAL_CACHE MARISA_SMALL_CACHE = C.MARISA_SMALL_CACHE MARISA_TINY_CACHE = C.MARISA_TINY_CACHE MARISA_DEFAULT_CACHE = C.MARISA_NORMAL_CACHE )
View Source
const ( MARISA_TEXT_TAIL TailMode = C.MARISA_TEXT_TAIL MARISA_BINARY_TAIL = C.MARISA_BINARY_TAIL MARISA_DEFAULT_TAIL = C.MARISA_TEXT_TAIL )
View Source
const ( MARISA_LABEL_ORDER NodeOrder = C.MARISA_LABEL_ORDER MARISA_WEIGHT_ORDER = C.MARISA_WEIGHT_ORDER MARISA_DEFAULT_ORDER = C.MARISA_WEIGHT_ORDER )
Variables ¶
View Source
var NotFound error = errors.New("not found")
Functions ¶
This section is empty.
Types ¶
type BuildOption ¶
type BuildOption struct {
NumTries int
CacheLevel CacheLevel
TailMode TailMode
NodeOrder NodeOrder
}
func NewBuildOption ¶
func NewBuildOption() *BuildOption
type CacheLevel ¶
type CacheLevel int
type Keyset ¶
type Keyset struct {
// contains filtered or unexported fields
}
func (*Keyset) BuildWithOption ¶
func (k *Keyset) BuildWithOption(option *BuildOption) (*Trie, error)
type LookupCallback ¶
type Trie ¶
type Trie struct {
// contains filtered or unexported fields
}
func LoadTrieFromFile ¶
func (*Trie) CommonPrefixSearch ¶
func (t *Trie) CommonPrefixSearch(str string, callback LookupCallback) error
func (*Trie) PredictiveSearch ¶
func (t *Trie) PredictiveSearch(str string, callback LookupCallback) error
Click to show internal directories.
Click to hide internal directories.