Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/occurrence_counter/ext/string.rb
Instance Method Summary collapse
Instance Method Details
#word_occurrences(*pre_process) ⇒ Object
4 5 6 7 |
# File 'lib/occurrence_counter/ext/string.rb', line 4 def word_occurrences(*pre_process) text = self.gsub(/[\.,;:&*@!\(\)\"\'%]/, "") OccurrenceCounter.count(text.split(" "), *pre_process) end |