PHP Class Jyxo\SpamFilter

Author: Roman Řáha
Afficher le fichier Open project: jyxo/php

Méthodes publiques

Méthode 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 méthode

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
Résultat boolean

isBlack() public méthode

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

isLinkSpam() public méthode

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

isSpam() public méthode

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

setBlackList() public méthode

Sets word blacklist.
public setBlackList ( array $blackList ) : self
$blackList array Words blacklist
Résultat self

setIgnoreWords() public méthode

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