Class: Lunar::Scoring
- Inherits:
-
Object
- Object
- Lunar::Scoring
- Defined in:
- lib/lunar/scoring.rb
Overview
of a given text.
Instance Method Summary collapse
-
#initialize(words) ⇒ Scoring
constructor
A new instance of Scoring.
- #scores ⇒ Object
Constructor Details
Instance Method Details
#scores ⇒ Object
9 10 11 |
# File 'lib/lunar/scoring.rb', line 9 def scores @words.inject(Hash.new(0)) { |a, w| a[w] += 1 and a } end |