Module: Summarize
- Included in:
- String
- Defined in:
- lib/summarize.rb,
ext/summarize/summarize.c
Constant Summary collapse
- VERSION =
"1.0.3"
- LANGUAGES =
[ 'bg', # Bulgarian 'ca', # Catalan 'cs', # Czech 'cy', # Welsh 'da', # Danish 'de', # German 'el', # Greek 'en', # English 'eo', # Esperanto 'es', # Spanish 'et', # Creole 'eu', # Basque 'fi', # Finnish 'fr', # French 'ga', # Irish 'gl', # Galician 'he', # Hebrew 'hu', # Hungarian 'ia', # Interlingua 'id', # Indonesian 'is', # Icelandic 'it', # Italian 'lv', # Latvian 'mi', # Maori 'ms', # Malay 'mt', # Maltese 'nl', # Dutch 'nn', # Norweigan 'pl', # Polish 'pt', # Portuguese 'ro', # Romanian 'ru', # Russian 'sv', # Swedish 'tl', # Tagalog 'tr', # Turkish 'uk', # Ukrainian 'yi' # Yiddish ]
Class Method Summary collapse
Class Method Details
.parse_options(options = {}) ⇒ Object
:nodoc:
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/summarize.rb', line 55 def self.( = {}) #:nodoc: = { :ratio => 25, # percentage :language => 'en', # ISO 639-1 code :topics => false } = .merge(.symbolize_keys) if .key? :dictionary dict_file = [:dictionary] else raise "Language not supported" unless LANGUAGES.index([:language]) dict_file = File.join(File.(File.dirname(__FILE__)), "../ext/summarize/dic/#{[:language]}") end return [dict_file, [:ratio], [:topics]] end |