MCPcopy Index your code
hub / github.com/derekparker/trie

github.com/derekparker/trie @v3.2.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v3.2.1 ↗ · + Follow
66 symbols 247 edges 2 files 20 documented · 30% 4 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

GoDoc

Trie

Data structure and relevant algorithms for extremely fast prefix/fuzzy string searching.

Usage

Create a Trie with:

t := trie.New()

Add Keys with:

// Add can take in meta information which can be stored with the key.
// i.e. you could store any information you would like to associate with
// this particular key.
t.Add("foobar", 1)

Find a key with:

node, ok := t.Find("foobar")
meta := node.Meta()
// use meta with meta.(type)

Remove Keys with:

t.Remove("foobar")

Prefix search with:

t.PrefixSearch("foo")

Fast test for valid prefix:

t.HasKeysWithPrefix("foo")

Fuzzy search with:

t.FuzzySearch("fb")

Contributing

Fork this repo and run tests with:

go test

Create a feature branch, write your tests and code and submit a pull request.

License

MIT

Core symbols most depended-on inside this repo

Add
called by 38
trie.go
New
called by 12
trie.go
maskruneslice
called by 8
trie.go
PrefixSearch
called by 7
trie.go
PrefixSearchIter
called by 7
trie.go
FuzzySearch
called by 6
trie.go
AllKeyValues
called by 5
trie.go
Find
called by 5
trie.go

Shape

Function 44
Method 17
Struct 4
TypeAlias 1

Languages

Go100%

Modules by API surface

trie_test.go38 symbols
trie.go28 symbols

For agents

$ claude mcp add trie \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page