Skip to content

前缀树搜索;可组合词;trie;检测敏感词、违禁词等

Notifications You must be signed in to change notification settings

zehongyang/ytrie

Repository files navigation

ytrie

trie,组合词前缀树,检测敏感词、违禁词

go get github.com/zehongyang/ytrie

创建一个简单前缀树并使用

trie := ytrie.NewSimpleTrie()
trie.Add("中国")
trie.Add("北京")
//ok为true,并返回触发的词
ok, words := trie.Find("中国你好,北京你好")

创建一个组合词前缀树并使用

trie := ytrie.NewCombineTrie()
trie.Add("中国,大陆")
trie.Add("北京")
//ok为true,并返回触发的词
ok, words := trie.Find("中国你好,大陆统一")

About

前缀树搜索;可组合词;trie;检测敏感词、违禁词等

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages