Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/classifier/lsi/summary.rb
Overview
- Author
-
Lucas Carlson ([email protected])
- Copyright
-
Copyright © 2005 Lucas Carlson
- License
-
LGPL
Instance Method Summary collapse
- #paragraph_summary(count = 1, separator = " [...] ") ⇒ Object
- #split_paragraphs ⇒ Object
- #split_sentences ⇒ Object
- #summary(count = 10, separator = " [...] ") ⇒ Object
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_paragraphs ⇒ Object
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_sentences ⇒ Object
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 |