Class: Formula
- Inherits:
-
Object
- Object
- Formula
- Defined in:
- lib/formulas/formula.rb
Direct Known Subclasses
Automated_readability, Coleman_liau, Fake_formula, Flesch_kincaid_GL, Flesch_kincaid_RE, Gunning_fog, Smog
Instance Method Summary collapse
- #name ⇒ Object
-
#score(text, stats) ⇒ Object
text will be a Hash like so: data = { ‘raw’ => String, ‘words’ => Array, ‘sentences’ => Array, ‘syllables’ => Array }.
Instance Method Details
#name ⇒ Object
26 27 28 |
# File 'lib/formulas/formula.rb', line 26 def name 'Generic' end |
#score(text, stats) ⇒ Object
text will be a Hash like so: data =
'raw' => String,
'words' => Array,
'sentences' => Array,
'syllables' => Array
stats will be a Hash like so:
'string_length' => Fixnum,
'letter_count' => Fixnum,
'syllable_count' => Fixnum,
'word_count' => Fixnum,
'sentence_count' => Fixnum,
'average_words_per_sentence' => Float,
'average_syllables_per_word' => Float
22 23 24 |
# File 'lib/formulas/formula.rb', line 22 def score(text, stats) 0 end |