Class: Automated_readability
Instance Method Summary collapse
- #calc_score(letter_count, word_count, sentence_count) ⇒ Object
- #name ⇒ Object
- #score(text, stats) ⇒ Object
Instance Method Details
#calc_score(letter_count, word_count, sentence_count) ⇒ Object
7 8 9 |
# File 'lib/formulas/ari.rb', line 7 def calc_score(letter_count, word_count, sentence_count) (((4.71 * (letter_count.to_f / word_count.to_f)) + (0.5 * (word_count.to_f / sentence_count.to_f))) - 21.43).round(1) end |
#name ⇒ Object
11 12 13 |
# File 'lib/formulas/ari.rb', line 11 def name 'Automated Readability Index' end |
#score(text, stats) ⇒ Object
3 4 5 |
# File 'lib/formulas/ari.rb', line 3 def score(text, stats) calc_score(stats['letter_count'], stats['word_count'], stats['sentence_count']) end |