Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Trie ¶
func LoadFromFile ¶
LoadFromFile loads a gib encoded wordlist from a file and creates a new Trie by Add()ing all of them.
func New ¶
func New() *Trie
NewTrie returns the pointer to a new Trie with an initialized root Branch
func (*Trie) Find ¶
Find returns all entries of the Trie that have the given prefix with their counts as Leaf sorted by weights
func (*Trie) FindFirstN ¶
FindFirstN returns first N results for given prefix sorted by weights
func (*Trie) SaveToFile ¶
SaveToFile dumps all values into a slice of strings and writes that to a file using encoding/gob.
The Trie itself can currently not be encoded directly because gob does not directly support structs with a sync.Mutex on them.
Click to show internal directories.
Click to hide internal directories.