2017 © Pedro Peláez
 

library leo-profanity

Profanity filter, based on Shutterstock dictionary

image

jojoee/leo-profanity

Profanity filter, based on Shutterstock dictionary

  • Wednesday, April 12, 2017
  • by jojoee
  • Repository
  • 2 Watchers
  • 2 Stars
  • 13 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 6 Versions
  • 8 % Grown

The README.md

leo-profanity-php

Latest Version on Packagist ![Software License][ico-license] Build Status, (*1)

Profanity filter, based on Shutterstock dictionary, (*2)

Install

Via Composer, (*3)

``` bash $ composer require jojoee/leo-profanity, (*4)


``` php use Jojoee\Library\LeoProfanity as LeoProfanity; $filter = new LeoProfanity(); $filter->check('I have BoOb');

Usage

$filter->getList()

``` php // return all profanity words (string[]) $filter->getList();, (*5)


### $filter->check(string) Check out mor example on `clean` method ``` php // output: true $filter->clean('I have boob');

$filter->clean(string, [replaceKey=*])

``` php // no bad word // output: I have 2 eyes $filter->clean('I have 2 eyes');, (*6)

// normal case // output: I have ****, etc. $filter->clean('I have boob, etc.');, (*7)

// case sensitive // output: I have **** $filter->clean('I have BoOb');, (*8)

// separated by comma and dot // output: I have ****. $filter->clean('I have BoOb.');, (*9)

// multi occurrence // output: I have ****,****, ***, and etc. $filter->clean('I have boob,boob, ass, and etc.');, (*10)

// should not detect unspaced-word // output: Buy classic watches online $filter->clean('Buy classic watches online');, (*11)

// clean with custom replacement-character // output: I have ++++ $filter->clean('I have boob', '+');, (*12)


### $filter->add(string|string[]) ``` php // add word $filter->add('b00b'); // add word's array // check duplication automatically $filter->add(['b00b', 'b@@b']);

$filter->remove(string|string[])

``` php // remove word $filter->remove('b00b');, (*13)

// remove word's array $filter->remove(['b00b', 'b@@b']); ```, (*14)

$filter->reset()

Reset word list by using default dictionary (also remove word that manually add), (*15)

$filter->clearList()

Clear all profanity words, (*16)

Note

TODO

  • [x] Unit test
  • [x] Test coverage
  • [x] PHP CodeSniffer
  • [x] Support PHP version 5.6, 7.0, hhvm

Other languages

Contribute

Please run composer check and fix before commit, (*17)

Reference

The Versions

12/04 2017

dev-master

9999999-dev https://github.com/jojoee/leo-profanity-php

Profanity filter, based on Shutterstock dictionary

  Sources   Download

MIT

The Requires

  • php ~5.6|~7.0

 

The Development Requires

filter profanity swear list string clean word words bad curse dirty obscene

31/03 2017

v1.2.2

1.2.2.0 https://github.com/jojoee/leo-profanity-php

Profanity filter, based on Shutterstock dictionary

  Sources   Download

MIT

The Requires

  • php ~5.6|~7.0

 

The Development Requires

filter profanity swear list string clean word words bad curse dirty obscene

17/03 2017

1.2.2

1.2.2.0 https://github.com/jojoee/leo-profanity-php

Profanity filter, based on Shutterstock dictionary

  Sources   Download

MIT

The Requires

  • php ~7.0

 

The Development Requires

filter profanity swear list string clean word words bad curse dirty obscene

13/03 2017

0.0.3

0.0.3.0 https://github.com/jojoee/leo-profanity-php

Profanity filter, based on Shutterstock dictionary

  Sources   Download

MIT

The Requires

  • php ~5.6|~7.0

 

The Development Requires

filter profanity swear list string clean word words bad curse dirty obscene

13/03 2017

0.0.2

0.0.2.0 https://github.com/jojoee/leo-profanity-php

Profanity filter, based on Shutterstock dictionary

  Sources   Download

MIT

The Requires

  • php ~5.6|~7.0

 

The Development Requires

filter profanity swear list string clean word words bad curse dirty obscene

13/03 2017

0.0.1

0.0.1.0 https://github.com/jojoee/leo-profanity-php

Profanity filter, based on Shutterstock dictionary

  Sources   Download

MIT

The Requires

  • php ~5.6|~7.0

 

The Development Requires

filter profanity swear list string clean word words bad curse dirty obscene