Skip to content

yuansudong/sensitive

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

1. Description

该项目主要用作于敏感词检测,并将检测到的敏感词屏蔽为*号.

2. Usage

go get github.com/yuansudong/sensitive

3. Example

package main
import (
	"github.com/yuansudong/sensitive"
)

// _LoadSensitiveWords 加载敏感词
func _LoadSensitiveWords() []string {
    return []string{
        "haha",
        "hello",
        "悲",
    }
}


func main() {
    sensitive.Init(_LoadSensitiveWords)
    mInst :=  sensitive.Get()
    log.Println(mInst.Replace("haha,人生若如初见,何事秋风悲画扇"))
    mInst.Release()
}

About

敏感词检测库

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages