Sha256: f3d19d9f93492d0cc4440f953b93d615cf179bbd7fa3aceaf0f19badf688a0a5

Contents?: true

Size: 853 Bytes

Versions: 1

Compression:

Stored size: 853 Bytes

Contents

module Boilerpipe
  java_import java.net.URL

  module Extractors
    class ArticleSentencesExtractor
      java_import 'com.kohlschutter.boilerpipe.extractors.ArticleSentencesExtractor'

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

      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
        ArticleSentencesExtractor::INSTANCE.get_text(input)
      end

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

  class ArticleSentencesExtractor
    def self.get_text(s)
      Extractors::ArticleSentencesExtractor.get_text s
    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.3.0 lib/boilerpipe/extractors/article_sentences_extractor.rb