https://github.com/quansitech/qs-sensitive
敏感词过滤
https://github.com/quansitech/qs-sensitive
Last synced: about 1 year ago
JSON representation
敏感词过滤
- Host: GitHub
- URL: https://github.com/quansitech/qs-sensitive
- Owner: quansitech
- License: mit
- Created: 2020-04-08T03:52:45.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-10-23T07:47:06.000Z (over 5 years ago)
- Last Synced: 2024-09-18T00:05:14.192Z (almost 2 years ago)
- Language: PHP
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 敏感词过滤
## 安装
```php
composer require quansitech/qs-sensitive
```
## 用法
```php
$sensitive = new Senstive();
$txt = "你是不是傻&吊。。。";
$words = $sensitive->filter($txt);
echo $words; // 你是不是***。。。
```
自定义干扰因子和敏感词库
```php
$disturbList = ['!', '(', ')'];
$words = './words.txt';
$sensitive = new Senstive($disturbList, $words);
$txt = "你是不是傻(!)吊。。。";
$words = $sensitive->filter($txt);
echo $words; //你是不是*****。。。
```