filter

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 14, 2021 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var TrackFilter = NewTrieFilter()

Functions

This section is empty.

Types

type TrieFilter

type TrieFilter struct {
	Root        *TrieNode
	Placeholder rune
}

func NewTrieFilter

func NewTrieFilter() *TrieFilter

func (*TrieFilter) Add

func (t *TrieFilter) Add(kw string)

添加关键词

func (*TrieFilter) Replace

func (t *TrieFilter) Replace(text string) string

过滤敏感词

func (*TrieFilter) Search

func (t *TrieFilter) Search(text string) string

查找是否存在关键词,并返回关键字

type TrieNode

type TrieNode struct {
	Children map[rune]*TrieNode
	End      bool
}

func NewTrieNode

func NewTrieNode() *TrieNode

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL