Class: Boilerpipe::Filters::MinWordsFilter

Inherits:
Object
  • Object
show all
Defined in:
lib/boilerpipe/filters/min_words_filter.rb

Class Method Summary collapse

Class Method Details

.process(min_words, doc) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/boilerpipe/filters/min_words_filter.rb', line 5

def self.process(min_words, doc)
  doc.text_blocks.each do |tb|
    next if tb.is_not_content?

    tb.content = false if tb.num_words < min_words
  end
  doc
end