Sha256: 7a39ffb117ff990f9a544631612107ac24a86ffe396cdd88ffccbf914993291c
Contents?: true
Size: 549 Bytes
Versions: 4
Compression:
Stored size: 549 Bytes
Contents
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
4 entries across 4 versions & 1 rubygems