lib/boilerpipe.rb in jruby-boilerpipe-0.1.0 vs lib/boilerpipe.rb in jruby-boilerpipe-0.2.0.rc1

- old
+ new

@@ -1,8 +1,18 @@ -require_relative 'boilerpipe-common-2.0-SNAPSHOT-jar-with-dependencies.jar' require 'boilerpipe/version' -require 'boilerpipe/sax/boilerpipe_html_parser' -require 'boilerpipe/document/document' -require 'boilerpipe/extractors/article_extractor' -require 'boilerpipe/extractors/default_extractor' -require 'boilerpipe/filters/filters' -require 'boilerpipe/labels/labels' +require_relative 'boilerpipe-common-2.0-SNAPSHOT-jar-with-dependencies.jar' + +module Boilerpipe + java_import 'com.kohlschutter.boilerpipe.extractors.ArticleExtractor' + java_import java.net.URL + + class ArticleExtractor + def self.get_text(s) + url = URL.new(s) + ArticleExtractor::INSTANCE.get_text(url) + end + + class <<self + alias_method :text, :get_text + end + end +end