Skip to content

exp-ouroborous/compact-trie

Repository files navigation

GoDoc

Compact-Trie (beta)

A data structure to compactly store words or more generally ordered rune slices. See Trie for more info.

Usage

Create a Trie with:

t := trie.New("Trie_Name")

Create a Trie from file of newline delimited words:

t := trie.NewFromFile("file_name","Trie_Name")

Add words (and data) with:

t.Add("word",data)

Check if a word is in the trie:

// A nil error means that the word was found
n, err := t.Find("word")

Remove a word from the trie:

// A nil error means that the word was successfully removed
err := t.Remove("word")

Visualize the trie using a linux tree:

fmt.Println(t.String())

TODO

  • Add fuzzy word search

License

MIT

About

A data structure to compactly store words or more generally ordered rune slices

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages