PHP Class Jyxo\SpamFilter

Author: Roman Řáha
Datei anzeigen Open project: jyxo/php

Public Methods

Method Description
isBabble ( string $text ) : boolean Returns if the text consists of repeating parts.
isBlack ( string $text ) : boolean Returns if the given text contains blacklisted words.
isLinkSpam ( string $text ) : boolean Returns if the text contains too many links.
isSpam ( string $text ) : boolean Checks if the given text is spam.
setBlackList ( array $blackList ) : self Sets word blacklist.
setIgnoreWords ( array $ignoreWords ) : self Sets ignored word list.

Method Details

isBabble() public method

Returns true if the number of at least three times repeated words is greater than 3/4 of all words.
public isBabble ( string $text ) : boolean
$text string Checked text
return boolean

isBlack() public method

Returns if the given text contains blacklisted words.
public isBlack ( string $text ) : boolean
$text string Checked text
return boolean

isLinkSpam() public method

Returns if the text contains too many links.
public isLinkSpam ( string $text ) : boolean
$text string Checked text
return boolean

isSpam() public method

Checks if the given text is spam.
public isSpam ( string $text ) : boolean
$text string Checked text
return boolean

setBlackList() public method

Sets word blacklist.
public setBlackList ( array $blackList ) : self
$blackList array Words blacklist
return self

setIgnoreWords() public method

Sets ignored word list.
public setIgnoreWords ( array $ignoreWords ) : self
$ignoreWords array Ignored words list
return self