Giter Club home page Giter Club logo

worps's Introduction

About Worps | PHP!

Control all text in multiple file bad words filter with worps

If you try online Click

What to do use for worps

  • Create new object
  • Worps constructor need files. Give files
  • Call convert method. Convert method need filter text
  • Convert method return filtered text.

Files Property

Giving files must are array and these arrays must be path property

$files = array(
	["path" => "./files/bad.txt"],
	["path" => "./files/empty.txt" , "separator" => ","]
);

If your files in each words not be new lines giving array inside separator property

Example File (not need separator property because each word new line)

File bad.txt

bad
word

Example File (need separator property because each word not new line and separator property must be value = " , " )

File empty.txt

bad,word

Usage Code

require  './worps.php'; //First we need source file.
$files = array(
["path" => "./files/bad.txt"]
);//Give as you want file with array

$worps = new Worps($files); //Create new Worps object
$text = $worps->convert("i am using bad words right now really BAD");
//convert method return filtered text use $text variable 
print($text);//Output : i am using *** words right now really ***

Methods

setHeader ( $header )

$worps->setHeader('Content-type: text/html; charset=utf-8')

getFiles

$worps->getFiles()

getFiles return all giving files

getRegExp

$worps->getRegExp()	

getRegExp return Regular expression has value. Default value = /\w+/

setRegExp ( $exp)

$worps->setRegExp('/\w+i/')

setShownText ( $length = null, $specialChar = false , $isShuffle = false)

$worps->setShownText(5,false,true)

setShownText method works filtered words how looks

  • $length parameter mean the filtered words how many letter hidden If you give null value filtered until words hidden self letter
  • $specialChar parameter mean the filtered words how look This parameter need array
    $worps->setShownText(null,['!','#','@'],false)
  • $isShuffle parameter mean the filtered words is shuffling

getText

$worps->getText()

This methods return giving not converted text

convert ( $text )

$text = $worps->convert("i am using bad words right now really BAD");
print($text)//i am using *** words right now really ***

This methods return converted (filtered) text

getConvertedText

$worps->getConvertedText()

This methods return converted (filtered) text This methods use before call convert method

getHiddenWordsGroup

$text = $worps->convert("i am using bad words right now really BAD");
print($worps->getHiddenWordsGroup())
//Array ( [bad] => 2)

getHiddenWords ( $filter = null )

$text = $worps->convert("i am using bad words right now really BAD");
print($worps->getHiddenWords())
//Array ( [0] => bad [1] => bad )
  • If $filter parameter giving return filtered words
   	$text = $worps->convert("i am using bad words right now really 	BAD");
   	print($worps->getHiddenWords('break'))
   	//Array ()

getAllWords ( $filter = null )

$text = $worps->convert("i am using bad words right now really BAD");
print($worps->getAllWords())
//Array ( [0] => Array ( [0] => damn [1] => bad ) [1] => Array ( [0] => break ) )
  • If $filter parameter not giving or giving null return all files in words.Else return giving files index words. This parameter accept file index.
   	$text = $worps->convert("i am using bad words right now really 	BAD");
   	print($worps->getAllWords(0))
   	//Array([0] => damn [1] => bad)

Screen Shoot

Uygulama Ekran Görüntüsü

worps's People

Contributors

devepdogu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.