Class: String

Inherits:
Object
  • Object
show all
Extended by:
Summarize
Defined in:
lib/summarize.rb

Constant Summary

Constants included from Summarize

Summarize::LANGUAGES, Summarize::VERSION

Instance Method Summary collapse

Methods included from Summarize

parse_options, summarize

Instance Method Details

#summarize(options = {}) ⇒ Object

Summarizes a string

Options:

ratio

A Fixnum from 0 to 100

language

An ISO 639-1 language code. See Summarize::LANGUAGES for the supported list.

dictionary

A path to a custom stemming XML file

topics

A boolean indicating whether to return topics as well. Return value will be an array instead with content first and topics second. Default is false.

Returns:

A string summary OR an array of content and topics



98
99
100
101
# File 'lib/summarize.rb', line 98

def summarize(options = {})
  dict_file, ratio, topics = Summarize.parse_options(options)
  String.send(:summarize, self, dict_file, ratio, topics)
end