Class: DespamilatorFilter::LongWords

Inherits:
Despamilator::Filter show all
Defined in:
lib/despamilator/filter/long_words.rb

Instance Method Summary collapse

Instance Method Details

#descriptionObject



11
12
13
# File 'lib/despamilator/filter/long_words.rb', line 11

def description
  'Detects long and unbroken strings'
end

#nameObject



7
8
9
# File 'lib/despamilator/filter/long_words.rb', line 7

def name
  'Long Words'
end

#parse(subject) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/despamilator/filter/long_words.rb', line 15

def parse subject
  subject.text.without_uris.words.each do |word|
    subject.register_match!({
      :score => 0.1, :filter => self
    }) if word.length > 20
  end
end