Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/reclassifier/core_ext/string.rb
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
6 7 8 |
# File 'lib/reclassifier/core_ext/string.rb', line 6 def paragraph_summary( count=1, separator=" [...] " ) perform_lsi split_paragraphs, count, separator end |
#split_paragraphs ⇒ Object
14 15 16 |
# File 'lib/reclassifier/core_ext/string.rb', line 14 def split_paragraphs split /(\n\n|\r\r|\r\n\r\n)/ # TODO: make this less primitive end |
#split_sentences ⇒ Object
10 11 12 |
# File 'lib/reclassifier/core_ext/string.rb', line 10 def split_sentences split /(\.|\!|\?)/ # TODO: make this less primitive end |
#summary(count = 10, separator = " [...] ") ⇒ Object
2 3 4 |
# File 'lib/reclassifier/core_ext/string.rb', line 2 def summary( count=10, separator=" [...] " ) perform_lsi split_sentences, count, separator end |