Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Iter ¶
Iter is a function type used as an argument to ForEach. It's arguments are the same as what would be returned on each for loop cycle, namely a rune and a map of nodes.
type Node ¶
The Node type makes up the Trie data structure.
Example ¶
trie := New() trie.Index([]string{"ab", "ac", "ad", "abc"}) fmt.Printf("%q", trie.Search("ab"))
Output: ["ab" "abc"]
func (Node) All ¶
All returns all the strings indexed by the current node and it's children in an array each item prefixed by p.
func (Node) ForEach ¶
ForEach wraps the for loop and additionally checks for the end rune and ignores it.
func (Node) Insert ¶
Insert adds a new word to the Trie. It iterates over s and creates or appends a new Node for each rune.
Click to show internal directories.
Click to hide internal directories.