linshaoneng/sensitive-word
Composer 安装命令:
composer require linshaoneng/sensitive-word
包简介
Using DFA algorithm to check whether sensitive words are included
README 文档
README
使用dfa算法检查是否包含敏感词/Using DFA algorithm to check whether sensitive words are included
安装/Installation
$ composer require linshaoneng/sensitive-word
使用方法 $badWords 为需要检查的敏感词/Basic Usage
require_once "./vendor/autoload.php"; use linshaoneng\Sensitive\SensitiveWordTree; $Sensitive = new SensitiveWordTree(); $badWords = ['发票','口罩']; $Sensitive->addWordstoTree( $badWords ); $text1 = '发票,发票要吗?口罩也有'; $text2 = '团结友善'; print_r( $Sensitive->checkBadWords($text1)); print_r( $Sensitive->checkBadWords($text2));
##返回如下
包含敏感词信息: Array ( [0] => 发票 [1] => 口罩 ) 并无敏感词信息 Array( )
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: proprietary
- 更新时间: 2020-05-28