[pressure.to logo -> link to home]



Ruby // readability



quick digest of this page's contentThis page:
"one or more ruby modules"

some links of relevanceRelated websites:
ruby [ruby homepage]
YARAA [ruby application archive]
pressure [home page for this site]


Lingua::EN::Readability is a Ruby module which calculates statistics on English text. It can supply counts of words, sentences and syllables. It can also calculate several readability measures, such as a Fog Index and a Flesch-Kincaid level. The package includes the module Lingua::EN::Sentence, which breaks English text into sentences heeding abbreviations, and Lingua::EN::Syllable, which can guess the number of syllables in a written English word. If a pronouncing dictionary is available it can look up the number of syllables in the dictionary for greater accuracy

It is a based on the Perl modules Lingua::EN::Fathom, Lingua::EN::Sentence and Lingua::EN::Syllable.



require 'lingua/en/readability'

text = 'This is the text sample to be analysed.' 
report = Lingua::EN::Readability.new(text) 
report.num_sentences # 1 
report.num_words     # 8 
report.num_syllables # 12 
report.report        # a formatted summary of statistics and measures