2017 © Pedro Peláez
 

library php-moderator

Content moderation

image

chtombleson/php-moderator

Content moderation

  • Saturday, September 12, 2015
  • by chtombleson
  • Repository
  • 1 Watchers
  • 0 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

PHPModerator

Build Status, (*1)

Static text analysis for inapporiate content., (*2)

Setup

Install using composer, (*3)

$ composer.phar require chtombleson\php-moderator

Usage

<?php
require_once(__DIR__ . /vendor/autoload.php');
use chtombleson\PHPModerator;

$moderator = new PHPModerator();
$message = "Long message from user you want to statically moderate";
$result = $moderator->moderate($message);

if ($result['status'] == 'pass') {
    echo "Message is below the threshold of: " . ($moderator->getThreshold() * 100) . "%";
    echo "Messgae contained the following amount of bad words: " . $result['bad_words'];
    echo "Message contained the following amount of spam words: " . $result['spam_words'];
    ehco "Message contains the following number of words: " . str_word_count($message);
} else {
    echo "Message fails static analysis of a threshold of:  . ($moderator->getThreshold() * 100) . "%";
    echo "Messgae contained the following amount of bad words: " . $result['bad_words'];
    echo "Message contained the following amount of spam words: " . $result['spam_words'];
    ehco "Message contains the following number of words: " . str_word_count($message);
}

Tests

Tests are run by PHPUnit, (*4)

phpunit tests/ModeratorTest.php

License

See LICENSE, (*5)

The Versions

12/09 2015

dev-master

9999999-dev

Content moderation

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

by Christopher Tombleson

06/05 2014

v0.1

0.1.0.0

Content moderation

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

by Christopher Tombleson