Skip to content

Maythink/word-filter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Word-filter

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

Usage

Create a Trie with:

f := filter.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.
f.Add("大法", 1)
f.Add("大法师", 1)

Find a key with:

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

Remove Keys with:

f.Remove("大法师")

Word filter with:

f.Filter("大法师","*")

Prefix search with:

f.PrefixSearch("大")

Fast test for valid prefix:

f.HasKeysWithPrefix("大")

Fuzzy search with:

f.FuzzySearch("大")

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages