sensitive

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddWord

func AddWord(words ...string)

AddWord 添加敏感词

func Default

func Default() *sensitive.Filter

func DelWord

func DelWord(words ...string)

DelWord 删除敏感词

func Filter

func Filter(text string) string

Filter 过滤敏感词

func FindAll

func FindAll(text string) []string

FindAll 找到所有匹配词

func FindIn

func FindIn(text string) (bool, string)

FindIn 检测敏感词

func IsInitialized

func IsInitialized() bool

func Load

func Load(rd io.Reader) error

Load common method to add words

func LoadNetWordDict

func LoadNetWordDict(url string) error

LoadNetWordDict 加载网络敏感词字典

func LoadWordDict

func LoadWordDict(path string) error

LoadWordDict 加载敏感词字典

func RemoveNoise

func RemoveNoise(text string) string

RemoveNoise 去除空格等噪音

func Replace

func Replace(text string, repl rune) string

Replace 和谐敏感词

func Reset

func Reset()

Reset 重置

func UpdateNoisePattern

func UpdateNoisePattern(pattern string)

UpdateNoisePattern 更新去噪模式

func Validate

func Validate(text string) (bool, string)

Validate 检测字符串是否合法

Types

This section is empty.

Jump to

Keyboard shortcuts

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