php-dfa-sensitive icon indicating copy to clipboard operation
php-dfa-sensitive copied to clipboard

:see_no_evil: 实现过滤敏感词汇:underage:,基于确定有穷自动机(DFA)算法,支持composer安装扩展

Results 9 php-dfa-sensitive issues
Sort by recently updated
recently updated
newest added

请问,是否可以设分别设置敏感词树、停用词树、以及黑名单

如题。 可以的话还请加上开源协议,感谢。 😃

测试发现 islegal 为 true 时实际上包含敏感词,为 false 时反而不包含敏感词。 islegal 返回 true 时应为合法的,无敏感词。

` // 获取感词库索引数组 $wordData = array( '傻逼', '狗', '麻痹', '尼玛', ); $content = "我擦,——————————你麻痹的——————,尼玛的,你个傻逼"; // 敏感词替换为***为例 $filterContent = SensitiveHelper::init()->setTree($wordData)->replace($content, '*'); var_dump($filterContent); ` 例如 $content = $content = "我擦,——————————你麻。。。痹的——————,尼玛的,你个傻逼"; “麻痹”,中间加了“。。。” 变成...

增加mysql、sqlite支持