Documentation ¶
Overview ¶
Package trie implements a in-memory trie tree. Reference: Trie - Wikipedia, the free encyclopedia
Index ¶
- type Trie
- func (tr *Trie) Clear()
- func (tr *Trie) Get(key string) interface{}
- func (tr *Trie) Has(key string) bool
- func (tr *Trie) Len() int
- func (tr *Trie) Map() map[string]interface{}
- func (tr *Trie) Match(pattern string) map[string]interface{}
- func (tr *Trie) Matched(s string) map[string]interface{}
- func (tr *Trie) NumMatch(pattern string) int
- func (tr *Trie) Pop(key string) interface{}
- func (tr *Trie) Put(key string, value interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Trie ¶
type Trie struct {
// contains filtered or unexported fields
}
Trie is the trie tree.
func (*Trie) Match ¶
Match trie items by a wildcard like pattern, the pattern is not a traditional wildcard, only "*" is supported, a sinle "*" represents a single word. Returns an empty map if the given pattern matches no items.
func (*Trie) Matched ¶ added in v0.2.1
Matched uses the trie items as the wildcard like patterns, filters out the items matches the given string. Returns an empty map if the given strings matches no patterns.
func (*Trie) NumMatch ¶ added in v0.2.1
NumMatch returns the number of items matching given pattern. Better than len(tr.Match(pattern)).
Click to show internal directories.
Click to hide internal directories.