定制 nelsonkti/sensitive-word 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

nelsonkti/sensitive-word

最新稳定版本:v1.0.0

Composer 安装命令:

composer require nelsonkti/sensitive-word

包简介

敏感词

README 文档

README

过滤敏感词,采用 DFA 算法

增加包含词的过滤(如:敏感、敏感词)

Installation

$ composer require nelsonkti/sensitive-word

Laravel

引导服务 config/app.php

'providers' => [
    Nelsonkti\SensitiveWord\SensitiveWordServiceProvider::class,
],

'aliases' => [
    'SensitiveWord' => Nelsonkti\SensitiveWord\SensitiveWord::class,
],

Usage

基本使用:

use Nelsonkti\SensitiveWord\Facades\SensitiveWord;

$path = './word.txt'


$content = '敏感,敏感词需要过滤'; #检查内容
$filename = '/txt/sensitive-words.txt'; #敏感词文件路径

SensitiveWord::searchWord($content, $filename);
# 返回: array('敏感', '敏感词');

SensitiveWord::filterWord($content, $filename);
# 返回: **,***需要过滤

License

sensitive-word is licensed under The MIT License (MIT).

统计信息

  • 总下载量: 29.25k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-07-02