Skip to content
/ dfa Public

dfa is a sensitive word checker 敏感词检测

License

Notifications You must be signed in to change notification settings

bean-du/dfa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DFA 敏感词检测

golang dfa 敏感词检测算法实现,支持动态设置敏感词

    go get github.com/bean-du/dfa

example:

    sensitive := []string{"王八蛋", "王八羔子"}

    fda := New()
    fda.AddBadWords(sensitive)

    str := "你个王#八……羔子, 你就是个王*八/蛋"
    fmt.Println(fda.Check(str))

输出结果:

[#……羔子 */] true

目前只支持中文检测欢迎大家 issues  pr

About

dfa is a sensitive word checker 敏感词检测

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages