Class: Bable::Index::ColemanLiau

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

Overview

This class is responsible of calculating the Coleman-Liau Index. Check en.wikipedia.org/wiki/Coleman%E2%80%93Liau_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



6
7
8
9
# File 'lib/bable/index/coleman_liau.rb', line 6

def calc
  (0.0588 * average_chars_per_100_words -
    0.296 * average_sentences_per_100_words - 15.8).round(2)
end