Skip to content

Latest commit

 

History

History
25 lines (18 loc) · 494 Bytes

README.md

File metadata and controls

25 lines (18 loc) · 494 Bytes

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