Sha256: e14200d608b34cf801eff7160a3410894a74ae6044bc22f6b060c8d2c8267c7f

Contents?: true

Size: 655 Bytes

Versions: 1

Compression:

Stored size: 655 Bytes

Contents

require 'boilerpipe/version'
require_relative 'boilerpipe-common-2.0-SNAPSHOT-jar-with-dependencies.jar'

module Boilerpipe
  java_import 'com.kohlschutter.boilerpipe.extractors.ArticleExtractor'
  java_import 'com.kohlschutter.boilerpipe.util.UnicodeTokenizer'
  java_import java.net.URL

  class ArticleExtractor
    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

    class <<self  
      alias_method :text, :get_text
    end 
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jruby-boilerpipe-0.0.2 lib/boilerpipe.rb