Simple nodejs text censor for
A simple&basic text filter that is under censor of GFW, with DFA.
为nodejs提供的简单GFW敏感词过滤器,使用DFA实现。
Usagevar tc = require('text-censor')
tc.filter('Ur so sexy babe!',function(err, censored){
console.log(censored) // 'Ur so ***y babe!'
})
If you want to add key words of your own, simply add them to the end of 'keywords' file, one word per line.
在'keywords'文件末尾增加自定义敏感词,每行一个。
PerformanceUnder 1ms for a 10-20 words sentence. Around 10ms for 1000 words.
10-20字的短句在1ms以内替换完成,1000字左右需要10ms左右
ThanksKeyword list from https://github.com/observerss/textfilter
LicenseMIT
版权声明:
1、该文章(资料)来源于互联网公开信息,我方只是对该内容做点评,所分享的下载地址为原作者公开地址。2、网站不提供资料下载,如需下载请到原作者页面进行下载。