gghuaxina / dfa Goto Github PK
View Code? Open in Web Editor NEW敏感词过滤
敏感词过滤
敏感词 AB,ABC,
ABC能替换,AB不会
https://github.com/wangjinglian/DFA/blob/b11be1e563c7970a807dbc4c8975f6e1a50ee95a/dfa.js#L49应该先判断不存在再创建新的
如果过滤sentence只有一个字或者匹配的敏感词库只有一个时候
用户词语长度为1 :
问题:curState.nodes为空,肯定不会走替换逻辑
纠正: 在for里面判断curState.nodes是否为空,为空直接替换
敏感词库长度为1:
问题:判断完m[w]之后,不会走for的逻辑 因为长度是等于不是小于
纠正:j <= len
使用了被注释的demo测试
let test = new SWF();
test.builtSWL();
let res = test.filter('肉洞');
console.log(res);//肉洞```
并没有被过滤,哪里不对吗?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.