-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
90 lines (58 loc) · 1.71 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
Lingua::EN::Fathom - readability and general measurements of English text
SYNOPSIS
use Lingua::EN::Fathom;
my $text = Lingua::EN::Fathom->new();
$text->analyse_file("sample.txt");
$accumulate = 1;
$text->analyse_block($text_string,$accumulate);
# Methods to return statistics on the analysed text
$text->num_chars;
$text->num_words;
$text->percent_complex_words;
$text->num_sentences;
$text->num_text_lines;
$text->num_non_text_lines;
$text->num_blank_lines;
$text->num_paragraphs;
$text->syllables_per_word;
$text->words_per_sentence;
$text->unique_words;
$text->fog;
$text->flesch;
$text->kincaid;
%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.
A hash of all unique words and the number of times they occur is generated.
REQUIRES
Lingua::EN::Syllable, Lingua::EN::Sentence
HOW TO INSTALL
perl Makefile.PL
make
make test
make install
or..
perl Build.PL
build
build test
build install
AUTHOR
Lingua::EN::Fathom was written by Kim Ryan, kimryan at cpan dot org.
COPYRIGHT AND LICENSE
Copyright (c) 2023 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.