quansitech/qs-sensitive

sensitive words

v1.0.3 2020-10-23 07:45 UTC

This package is auto-updated.

Last update: 2024-11-23 16:50:44 UTC


README

安装

composer require quansitech/qs-sensitive

用法

$sensitive = new Senstive();
$txt = "你是不是傻&吊。。。";
$words = $sensitive->filter($txt);

echo $words; // 你是不是***。。。

自定义干扰因子和敏感词库

$disturbList = ['!', '(', ')'];
$words = './words.txt';
$sensitive = new Senstive($disturbList, $words);
$txt = "你是不是傻(!)吊。。。";
$words = $sensitive->filter($txt);

echo $words; //你是不是*****。。。