Class: Boilerpipe::Extractors::ArticleExtractor

Inherits:
Object
  • Object
show all
Defined in:
lib/boilerpipe/extractors/article_extractor.rb

Class Method Summary collapse

Class Method Details

.get_text(s) ⇒ Object Also known as: text



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/boilerpipe/extractors/article_extractor.rb', line 12

def  self.get_text(s)
  url = nil

  begin
    url = Java::JavaNet::URL.new(s)
  rescue Java::JavaNet::MalformedURLException => e
    # not a URL
  end
  input = url ? url : s
  ArticleExtractor::INSTANCE.get_text(input)
end

.process(doc) ⇒ Object



8
9
10
# File 'lib/boilerpipe/extractors/article_extractor.rb', line 8

def self.process(doc)
  ArticleExtractor::INSTANCE.process doc
end