Overview

Namespaces

  • Jyxo
    • Beholder
      • TestCase
    • Gettext
      • Parser
    • Input
      • Chain
      • Filter
      • Validator
    • Mail
      • Email
        • Attachment
      • Parser
      • Sender
    • Rpc
      • Json
      • Xml
    • Shell
    • Spl
    • Svn
    • Time
    • Webdav
  • PHP

Classes

  • Charset
  • Color
  • Css
  • ErrorHandler
  • ErrorMail
  • FirePhp
  • Html
  • HtmlTag
  • SpamFilter
  • String
  • Timer
  • XmlReader

Exceptions

  • Exception
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated

Class 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.

Namespace: Jyxo
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