Documentation ¶
Index ¶
- type Node
- type SearchResult
- type Trie
- func (trie *Trie) Find(text string, f func(item SearchResult))
- func (trie *Trie) HasPrefix(prefix string) bool
- func (trie *Trie) IsContained(text string) bool
- func (trie *Trie) SortedWords() []string
- func (trie *Trie) ToJson() ([]byte, error)
- func (trie *Trie) Words() []string
- func (trie *Trie) WordsWithPrefix(prefix string) []string
- type TrieBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Node ¶
type SearchResult ¶
type Trie ¶
type Trie struct {
// contains filtered or unexported fields
}
func (*Trie) Find ¶
func (trie *Trie) Find(text string, f func(item SearchResult))
Find searches for all occurences in Trie datastructure.
func (*Trie) IsContained ¶
IsContained searches for first occurence of any word in Trie datastructure.
func (*Trie) SortedWords ¶ added in v1.0.0
func (*Trie) WordsWithPrefix ¶ added in v1.0.0
type TrieBuilder ¶
type TrieBuilder struct {
// contains filtered or unexported fields
}
func NewTrie ¶
func NewTrie() *TrieBuilder
func (*TrieBuilder) AddWord ¶
func (tb *TrieBuilder) AddWord(word string) *TrieBuilder
AddWord adds new word to list of words we will be searching for
func (*TrieBuilder) Optimize ¶
func (tb *TrieBuilder) Optimize(optimize bool) *TrieBuilder
func (*TrieBuilder) WithWords ¶
func (tb *TrieBuilder) WithWords(words ...string) *TrieBuilder
AddWord adds new word to list of words we will be searching for
Click to show internal directories.
Click to hide internal directories.