Documentation ¶
Index ¶
- type Filter
- func (filter *Filter) AddWord(words ...string)
- func (filter *Filter) Filter(text string) string
- func (filter *Filter) FindIn(text string) (bool, string)
- func (filter *Filter) LoadWordDict(path string) error
- func (filter *Filter) RemoveNoise(text string) string
- func (filter *Filter) Replace(text string, repl rune) string
- func (filter *Filter) UpdateNoisePattern(pattern string)
- type Node
- type Trie
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
Filter 敏感词过滤器
func (*Filter) LoadWordDict ¶
LoadWordDict 加载敏感词字典
func (*Filter) RemoveNoise ¶
RemoveNoise 去除空格等噪音
func (*Filter) UpdateNoisePattern ¶
UpdateNoisePattern 更新去噪模式
type Node ¶
type Node struct { Character rune Children map[rune]*Node // contains filtered or unexported fields }
Node Trie树上的一个节点.
Click to show internal directories.
Click to hide internal directories.