Skip to content

kimmel/Lingua-EN-Fathom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lingua::EN::Fathom - readability and general measurements of English text

SYNOPSIS

   use Lingua::EN::Fathom;

   my $text = new Lingua::EN::Fathom;

   $text->analyse_file("sample.txt");

   $accumulate = 1;
   $text->analyse_block($text_string,$accumulate);

   $num_chars             = $text->num_chars;
   $num_words             = $text->num_words;
   $percent_complex_words = $text->percent_complex_words;
   $num_sentences         = $text->num_sentences;
   $num_text_lines        = $text->num_text_lines;
   $num_blank_lines       = $text->num_blank_lines;
   $num_paragraphs        = $text->num_paragraphs;
   $syllables_per_word    = $text->syllables_per_word;
   $words_per_sentence    = $text->words_per_sentence;


   %words = $text->unique_words;
   foreach $word ( sort keys %words )
   {
      print("$words{$word} :$word\n");
   }

   $fog     = $text->fog;
   $flesch  = $text->flesch;
   $kincaid = $text->kincaid;

   print($text->report);


DESCRIPTION

This module analyses English text in either a string or file. Totals are
then calculated for the number of characters, words, sentences, blank
and non blank (text) lines and paragraphs.

Three common readability statistics are also derived, the Fog, Flesch and
Kincaid indices.

All of these properties can be accessed through individual methods, or by
generating a text report.


REQUIRES

Perl, version 5.001 or higher, Lingua::EN::Syllable


HOW TO INSTALL

    perl Makefile.PL
    make
    make test
    make install


BUGS

None known


AUTHOR

Lingua::EN::Fathom was written by Kim Ryan, kimryan at cpan dot org.


COPYRIGHT AND LICENSE

Copyright (c) 2007 Kim Ryan. All rights reserved.

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.4 or,
at your option, any later version of Perl 5 you may have available.