Skip to content

Commit

Permalink
Block formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
adambair committed Aug 9, 2009
1 parent 88a294d commit cad1875
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/profanity_filter.rb
Expand Up @@ -40,18 +40,14 @@ class << self
def clean(text, replace_method = '')
return text if text.blank?
@replace_method = replace_method
text.split(/(\s)/).collect{ |word|
clean_word(word)
}.join
text.split(/(\s)/).collect{ |word| clean_word(word) }.join
end

def clean_word(word)
return word unless(word.strip.size > 2)

if word.index(/[\W]/)
word = word.split(/(\W)/).collect{ |subword|
clean_word(subword)
}.join
word = word.split(/(\W)/).collect{ |subword| clean_word(subword) }.join
concat = word.gsub(/\W/, '')
word = concat if is_banned? concat
end
Expand Down

0 comments on commit cad1875

Please sign in to comment.