use Lingua::EN::Fathom; my $text = new Lingua::EN::Fathom; $text->analyse_file("sample.txt"); $text->analyse_block($text_string); $num_chars = $text->num_chars; $num_words = $text->num_words; $num_sentences = $text->num_sentences; $num_text_lines = $text->num_text_lines; $num_blank_lines = $text->num_blank_lines; %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);
This module analyses English text in either a string or file. Totals are then calculated for the number of characeters, words, sentences, blank and onon blank (text) lines.
Three common readablity statistics are also derived, the Fog, Flesch and Kincaid indices.
All of these properties can ve accessed through individual methods, or by generatring a text report.
Perl, version 5.001 or higher, Lingua::EN::Syllable
perl Makefile.PL make make test make install
0.01 23 Jan 2000: First Release
Copyright (c) 2000 Kim Ryan. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the Perl Artistic License (see http://www.perl.com/perl/misc/Artistic.html).
Fathom was written by Kim Ryan <kimaryan@ozemail.com.au> in 2000.
To install Lingua::EN::Fathom, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Lingua::EN::Fathom
CPAN shell
perl -MCPAN -e shell install Lingua::EN::Fathom
For more information on module installation, please visit the detailed CPAN module installation guide.