Overview

Packages

  • Jyxo_Beholder
  • Jyxo_Charset
  • Jyxo_Color
  • Jyxo_Css
  • Jyxo_ErrorHandling
  • Jyxo_FirePhp
  • Jyxo_Gettext
    • Parser
  • Jyxo_Html
  • Jyxo_Input
    • Chain
    • Filter
    • Validator
  • Jyxo_Mail
    • Email
    • Parser
    • Sender
  • Jyxo_Rpc
    • Json
    • Xml
  • Jyxo_Shell
  • Jyxo_SpamFilter
  • Jyxo_Spl
  • Jyxo_String
  • Jyxo_Svn
  • Jyxo_Time
  • Jyxo_Timer
  • Jyxo_Webdav
  • Jyxo_XmlReader
  • PHP

Classes

  • Jyxo_SpamFilter
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated

Class Jyxo_SpamFilter

Walks through the given text and computes individual words counts. If more than 3/4 words repeat the text is considered to be spam.

Category: Jyxo
Package: Jyxo_SpamFilter
Copyright: Copyright (c) 2005-2011 Jyxo, s.r.o.
License: https://github.com/jyxo/php/blob/master/license.txt
Author: Roman Řáha
Located at SpamFilter.php
Methods summary
public boolean
# isSpam( string $text )

Checks if the given text is spam.

Checks if the given text is spam.

Parameters

$text
string
Checked text

Returns

boolean
public boolean
# isBlack( string $text )

Returns if the given text contains blacklisted words.

Returns if the given text contains blacklisted words.

Parameters

$text
string
Checked text

Returns

boolean
public boolean
# isLinkSpam( string $text )

Returns if the text contains too many links.

Returns if the text contains too many links.

Parameters

$text
string
Checked text

Returns

boolean
public boolean
# isBabble( string $text )

Returns if the text consists of repeating parts. Returns true if the number of at least three times repeated words is greater than 3/4 of all words.

Returns if the text consists of repeating parts. Returns true if the number of at least three times repeated words is greater than 3/4 of all words.

Parameters

$text
string
Checked text

Returns

boolean
public Jyxo_SpamFilter
# setBlackList( array $blackList )

Sets word blacklist.

Sets word blacklist.

Parameters

$blackList
array
Words blacklist

Returns

Jyxo_SpamFilter
public Jyxo_SpamFilter
# setIgnoreWords( array $ignoreWords )

Sets ignored word list.

Sets ignored word list.

Parameters

$ignoreWords
array
Ignored words list

Returns

Jyxo_SpamFilter
Constants summary
integer LINK_MAX_COUNT 10
#

Maximal number of links in the text.

Maximal number of links in the text.

integer LINK_SHORT_MAX_COUNT 3
#

Maximal number of links in a short text.

Maximal number of links in a short text.

float LINK_MAX_RATIO 0.05
#

Ratio of links number to the total words number in the text.

Ratio of links number to the total words number in the text.

integer LINK_WORDS_MIN_COUNT 30
#

Minimal words count where the links ratio is computed.

Minimal words count where the links ratio is computed.

Jyxo PHP Library API documentation generated by ApiGen 2.3.0