Skip to content

Liuguozhu/Sensitive-word-filter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sensitive-word-filter

Sensitive word filtering

Translate directly from the DFA algorithm of Java.

The word library is just an example,can be replaced with other word libraries if you need, you can also add entries by yourself.

Call the load word library in the sensitivewordinit.go.

You can use the SensitiveWordFilter.go validation and replace sensitive words.

Use the example to see main.go

敏感词过滤

直接从Java版DFA算法实现翻译过来。

词库也为示例,可替换成其他词库,也可自行添加词条。

在SensitiveWordInit.go中调用加载词库

SensitiveWordFilter.go验证,替换敏感词

使用示例见main.go