An open API service indexing awesome lists of open source software.

https://github.com/quansitech/qs-sensitive

敏感词过滤
https://github.com/quansitech/qs-sensitive

Last synced: about 1 year ago
JSON representation

敏感词过滤

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; //你是不是*****。。。
```