Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/classifier/lsi/summary.rb

Overview

Author

Lucas Carlson ([email protected])

Copyright

Copyright © 2005 Lucas Carlson

License

LGPL

Instance Method Summary collapse

Instance Method Details

#paragraph_summary(count = 1, separator = " [...] ") ⇒ Object



10
11
12
# File 'lib/classifier/lsi/summary.rb', line 10

def paragraph_summary( count=1, separator=" [...] " )
   perform_lsi split_paragraphs, count, separator
end

#split_paragraphsObject



18
19
20
# File 'lib/classifier/lsi/summary.rb', line 18

def split_paragraphs
   split /(\n\n|\r\r|\r\n\r\n)/ # TODO: make this less primitive
end

#split_sentencesObject



14
15
16
# File 'lib/classifier/lsi/summary.rb', line 14

def split_sentences
   split /(\.|\!|\?)/ # TODO: make this less primitive
end

#summary(count = 10, separator = " [...] ") ⇒ Object



6
7
8
# File 'lib/classifier/lsi/summary.rb', line 6

def summary( count=10, separator=" [...] " )
   perform_lsi split_sentences, count, separator
end