Skip to content

Commit

Permalink
Updated read me
Browse files Browse the repository at this point in the history
  • Loading branch information
neilang committed Aug 5, 2009
1 parent d7a023a commit 73a7c18
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion README.rdoc
Expand Up @@ -17,7 +17,11 @@ Non-Destructive (filters content when called, original text remains in the datab
profanity_filter :foo, :bar
# banned words will be replaced with @#$%
profanity_filter :foo, :bar, :method => 'dictionary'
# banned words will be replaced by value in config/dictionary.yml
profanity_filter :foo, :bar, :method => 'vowels'
# banned words will have their vowels replaced
profanity_filter :foo, :bar, :method => 'hollow'
# all letters except the first and last will be replaced

The non-destructive profanity_filter provides different versions of the filtered attribute:
some_model.foo => 'filtered version'
Expand All @@ -28,12 +32,20 @@ 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 be replaced by value in config/dictionary.yml
profanity_filter! :foo, :bar, :method => 'vowels'
# banned words will have their vowels replaced
profanity_filter! :foo, :bar, :method => 'hollow'
# all letters except the first and last will be replaced



=== You can also use the filter directly:

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


== Benchmarks
Expand All @@ -45,7 +57,6 @@ You can run the benchmarks via:

== TODO

* This plugin is not currently filtering words that are punctuation delimited (ex. 'f-u-c-k').
* Turn this into a gem (and move over to rspec)
* May break ProfanityFilter out on it's own
* Clean up dictionary implementation and subsitution (suboptimal and messy)
Expand Down

0 comments on commit 73a7c18

Please sign in to comment.