2017 © Pedro Peláez
 

library laravel-sensitive

过滤敏感词汇的laravel包,使用DFA算法

image

yankewei/laravel-sensitive

过滤敏感词汇的laravel包,使用DFA算法

  • Saturday, July 29, 2017
  • by yankewei
  • Repository
  • 2 Watchers
  • 33 Stars
  • 215 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 1 Open issues
  • 3 Versions
  • 26 % Grown

The README.md

Laravel-sensitive

Sensitive Fliter for Laravel5 / Lumen based on tuyuwei/SensitiveWord., (*1)

Install

composer require yankewei/laravel-sensitive

For Laravel

Add the following line to the section providers of config/app.php:, (*2)

'providers' => [
    //...
    Yankewei\LaravelSensitive\SensitiveServiceProvider::class,
],

as optional, you can use facade:, (*3)


'aliases' => [ //... 'Sensitive' => Yankewei\LaravelSensitive\Facades\Sensitive::class, ],

For Lumen

Add the following line to bootstrap/app.php after // $app->withEloquent();, (*4)

...
// $app->withEloquent();

$app->register(Yankewei\LaravelSensitive\SensitiveServiceProvider::class);
...

Usage

Using facade:, (*5)

$interference = ['&', '*'];
$filename = './words.txt'; //每个敏感词独占一行
Sensitive::interference($interference); //添加干扰因子
Sensitive::addwords($filename); //需要过滤的敏感词
$txt = "我说的日本册,滚&蛋不是。。。";
$words = Sensitive::filter($txt);
dd($words);
"我说的**册,***不是。。。"

License

MIT, (*6)

The Versions

29/07 2017

dev-master

9999999-dev

过滤敏感词汇的laravel包,使用DFA算法

  Sources   Download

MIT

The Requires

  • php >=5.6

 

by Avatar yankewei

29/07 2017

v2.0.0

2.0.0.0

过滤敏感词汇的laravel包,使用DFA算法

  Sources   Download

MIT

The Requires

  • php >=5.6

 

by Avatar yankewei

11/06 2017

v1.0.0

1.0.0.0

过滤敏感词汇的laravel包,使用DFA算法

  Sources   Download

MIT

The Requires

  • php >=5.6

 

by Avatar yankewei