pavelpage/censorship 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

pavelpage/censorship

最新稳定版本:1.0.0

Composer 安装命令:

composer require pavelpage/censorship

包简介

This package can clean all non-normative lexis from your texts

README 文档

README

This package could be used for cleaning obscene language from user messages.

Usage

Installation

Simply install it using composer command:

composer require "pavelpage/censorship:dev-master"

Usage

You have to options for using this package:

Replace obscene words

$censor = new Censor();
$text = "some text";

$censor->clean($text);// will replace obscene words in your text

Check the text

$censor = new Censor();
$text = "some text";

$censor->hasObsceneWords($text);

Configuration

You have a few abilities to add functionality if you think, that package doesn't solute your problems.

Here are some parameters which you can replace in the config file:

Parameter Value
default_obscene_patterns default patterns which used to detect obscene words
obscene_patterns you can add your own patterns to find obscene words
replace_pattern place symbols which will replace obscene words
obscene_words simply write words which should be replaced
except_words also, you can exclude some words from checking
$censor = new Censor(['param_name' => []);// just send your custom configuration parameters to __construct method of controller

Demo:

You can visit this site demo and check how it is working.

Notice:

Now package works only with russian language, feel free to add english patterns or use some patterns from the examples directory(english.php).

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-04-18