public
Description: Fu-fu: The Profanity Filter for Rails.
Homepage: http://adambair.lighthouseapp.com/projects/12000-fu-fu/overview
Clone URL: git://github.com/adambair/fu-fu.git
adambair (author)
Sat Jun 13 18:45:37 -0700 2009
commit  549a727887d6801c605dbac23ad939479f7436be
tree    98de22bf8cb41aa9125e46a65966369e46f928ca
parent  8e9a068495254657d4fbcfcef52bb89742a95897
fu-fu /
name age message
file .gitignore Sun Jun 01 01:45:16 -0700 2008 Adding the rakefile back in and setting an ignore [adambair]
file MIT-LICENSE Thu Jun 05 12:29:50 -0700 2008 Adding MIT license file - thanks Simon [adambair]
file README Loading commit data...
file Rakefile Sun Jun 01 01:45:16 -0700 2008 Adding the rakefile back in and setting an ignore [adambair]
directory config/ Mon Jun 09 08:34:21 -0700 2008 Adding squeezed version of the p***y words to d... [scott-stewart]
file init.rb Sun Jun 01 01:30:14 -0700 2008 Initial import of the original plugin [adambair]
directory lib/
directory test/
README
Fu-fu: The Profanity Filter for Rails
===============

This plugin will allow you to filter profanity using basic replacement or a dictionary term.  


Disclaimer
=========

This plugin is provided as is - therefore, the creators and contributors of this plugin are not responsible for any 
damages that may result from it's usage.  Use at your own risk; backup your data.


Example
=======

You can use it in your models:

  Notice -- there are two profanity filters, one is destructive.  Beware the exclamation point (profanity_filter!).

  Non-Destructive (filters content when called, original text remains in the database)

    profanity_filter :foo, :bar
      # banned words will be replaced with @#$%
    profanity_filter :foo, :bar, :method => 'dictionary'
      # banned words will have their vowels replaced

    The non-destructive profanity_filter provides different versions of the filtered attribute:
      some_model.foo => 'filtered version'
      some_model.foo_original => 'non-filtered version'

  Destructive (saves the filtered content to the database)

    profanity_filter! :foo, :bar
      # banned words will be replaced with @#$%
    profanity_filter! :foo, :bar, :method => 'dictionary'
      # banned words will have their vowels replaced

You can also use the filter directly:

  ProfanityFilter::Base.clean(text)
  ProfanityFilter::Base.clean(text, 'dictionary')


Benchmarks
==========

Inquiring minds can checkout the simple benchmarks I've included so you can have an idea of what kind of performance to 
expect.  I've included some quick scenarios including strings of (100, 1000, 5000, 1000) words and dictionaries of (100, 
1000, 5000, 25000, 50000, 100000) words.

You can run the benchmarks via:
  /test/benchmark/fu-fu_benchmark.rb


TODO
====

This plugin is not currently filtering words that are punctuation delimited (ex. 'f-u-c-k').


Resources
=========

Created by Adam Bair (adam@intridea.com) of Intridea (http://www.intridea.com)