https://github.com/bean-du/dfa
dfa is a sensitive word checker 敏感词检测
https://github.com/bean-du/dfa
dfa golang-dfa
Last synced: 10 months ago
JSON representation
dfa is a sensitive word checker 敏感词检测
- Host: GitHub
- URL: https://github.com/bean-du/dfa
- Owner: bean-du
- License: mit
- Created: 2021-04-20T02:22:20.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2023-08-31T01:36:31.000Z (almost 3 years ago)
- Last Synced: 2024-10-01T09:35:32.133Z (almost 2 years ago)
- Topics: dfa, golang-dfa
- Language: Go
- Homepage:
- Size: 5.86 KB
- Stars: 44
- Watchers: 2
- Forks: 11
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DFA 敏感词检测
> golang dfa 敏感词检测算法实现,支持动态设置敏感词
```go
go get github.com/bean-du/dfa
```
example:
```go
sensitive := []string{"王八蛋", "王八羔子"}
fda := New()
fda.AddBadWords(sensitive)
str := "你个王#八……羔子, 你就是个王*八/蛋"
fmt.Println(fda.Check(str))
```
输出结果:
```go
[王#八……羔子 王*八/蛋] true
目前只支持中文检测,欢迎大家 issues 和 pr。
```