README.txt

Path: README.txt
Last Update: Mon Mar 23 18:28:57 -0400 2009

profanalyzer

DESCRIPTION:

Profanalyzer has one purpose: analyze a block of text for profanity. It is able to filter profane words as well.

What sets it slightly apart from other filters is that it classifies each blocked word as "profane", "racist", or "sexual" - although right now, each word is considered "profane". It also rates each word on a scale from 0-5, which is based on my subjective opinion, as well as whether the word is commonly used in non-profane situations, such as "ass" in "assess".

The Profanalyzer will default to a tolerance of of 2, which will kick back the arguably non-profane words. It will also test against all words, including racist or sexual words.

Lastly, it allows for custom substitutions! For example, the filter at the website www.fark.com/ turns the word "fuck" into "fark", and "shit" into "shiat". You can specify these if you want.

FEATURES/PROBLEMS:

  • Tolerance-based filtering
  • Switch between checking all words, racist terms, sexual words, or some mixture
  • Custom substitutions
  • Boolean-based profanity checking (skipping the filtering)

SYNOPSIS:

Out of the box, you can simply use Profanalyzer.filter and Profanalyzer.profane?:

    require 'rubygems'
    require 'profanalyzer'

    Profanalyzer.profane? "asshole" #==> true
    Profanalyzer.filter   "asshole" #==> "#!$%@&!"

Then you can change the tolerance:

    Profanalyzer.tolerance = 5
    Profanalyzer.profane? "hooker" #==> false

Or do specific checking:

    Profanalyzer.check_all = false # turn off catch-all checking
    Profanalyzer.check_racist = false # don't check racial slurs
    Profanalyzer.check_sexual = true # sexual checking on

    Profanalyzer.profane? "mick" #==> false
    Profanalyzer.profane? "vagina" #==> true

Lastly, you can add custom substitutions:

    Profanalyzer.substitute("shit","shiat")
    Profanalyzer.filter "shit" #==> "shiat"

    Profanalyzer.substitute(:fuck => :fark)
    Profanalyzer.filter("fuck") #==> "fark"

REQUIREMENTS:

hoe - a gem for building gems, which I used for profanalyzer.

INSTALL:

sudo gem install profanalyzer

LICENSE:

(The MIT License)

Copyright (c) 2009 FIX

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

[Validate]