Class: Gluttonberg::Content::DespamilatorFilter::LongWords

Inherits:
Gluttonberg::Content::Despamilator::Filter show all
Defined in:
lib/gluttonberg/content/despamilator/filter/long_words.rb

Instance Method Summary collapse

Instance Method Details

#descriptionObject



13
14
15
# File 'lib/gluttonberg/content/despamilator/filter/long_words.rb', line 13

def description
  'Detects long and unbroken strings'
end

#nameObject



9
10
11
# File 'lib/gluttonberg/content/despamilator/filter/long_words.rb', line 9

def name
  'Long Words'
end

#parse(subject) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/gluttonberg/content/despamilator/filter/long_words.rb', line 17

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