xiaobinqt/sensitive-words-filter
Composer 安装命令:
composer require xiaobinqt/sensitive-words-filter
包简介
sensitive words filter
README 文档
README
sensitive words filter.
Installing
$ composer require xiaobinqt/sensitive-words-filter -vvv
Usage
use Xiaobinqt\SensitiveWordsFilter\SensitiveWordsFilter; $haystack = "淫色 | ? [] sdfs0221。?!,、;:「」『』“”‘’()【】《》〈〉 电影"; $obj = new SensitiveWordsFilter(); try { $ret = $obj->filter($haystack); var_dump($ret); } catch (Exception $exception) { // TODO }
Return Resource
array( 'costTimeMs' => 21571.157217026, 'sensitiveWords' => "淫色电影" );
Advanced usage
- 自定义敏感词文件
$senPath = __DIR__ . DIRECTORY_SEPARATOR . 'mysen.txt'; $obj = new SensitiveWordsFilter($senPath);
- 自定义敏感词数组
$obj = new SensitiveWordsFilter(null, array("台湾独立建国"));
Contributing
You can contribute in one of three ways:
- File bug reports using the issue tracker.
- Answer questions or fix bugs on the issue tracker.
- Contribute new features or update the wiki.
The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.
License
MIT
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-07-25