Class: Bable::Index::Ari

Inherits:
Base
  • Object
show all
Defined in:
lib/bable/index/ari.rb

Overview

This class is responsible of calculating the Automated Readability Index. Check en.wikipedia.org/wiki/Automated_readability_index for knowing more.

Instance Attribute Summary

Attributes inherited from Base

#text

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Bable::Index::Base

Instance Method Details

#calcObject



7
8
9
10
# File 'lib/bable/index/ari.rb', line 7

def calc
  (4.71 * text.characters_count / text.words_count +
    0.5 * text.words_count / text.sentences_count - 21.43).round(2)
end