{
    "content": [
        {
            "type": "text",
            "text": "# Lingua::EN::Fathom (perldoc)\n\n## NAME\n\nLingua::EN::Fathom - Measure readability of English text\n\n## SYNOPSIS\n\nuse Lingua::EN::Fathom;\nmy $text = Lingua::EN::Fathom->new();\n# Analyse contents of a text file\n$text->analysefile(\"sample.txt\"); # Analyse contents of a text file\n$accumulate = 1;\n# Analyse contents of a text string\n$text->analyseblock($textstring,$accumulate);\n# TO Do, remove repetition\n$numchars             = $text->numchars;\n$numwords             = $text->numwords;\n$percentcomplexwords = $text->percentcomplexwords;\n$numsentences         = $text->numsentences;\n$numtextlines        = $text->numtextlines;\n$numblanklines       = $text->numblanklines;\n$numparagraphs        = $text->numparagraphs;\n$syllablesperword    = $text->syllablesperword;\n$wordspersentence    = $text->wordspersentence;\n# comment needed\n%words = $text->uniquewords;\nforeach $word ( sort keys %words )\n{\nprint(\"$words{$word} :$word\\n\");\n}\n$fog     = $text->fog;\n$flesch  = $text->flesch;\n$kincaid = $text->kincaid;\nprint($text->report);\n\n## DESCRIPTION\n\nThis module analyses English text in either a string or file. Totals are then calculated for the\nnumber of characters, words, sentences, blank and non blank (text) lines and paragraphs.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **REQUIRES**\n- **DESCRIPTION**\n- **METHODS**\n- **SEE ALSO**\n- **POSSIBLE EXTENSIONS**\n- **LIMITATIONS**\n- **BUGS**\n- **AUTHOR**\n- **COPYRIGHT AND LICENSE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Lingua::EN::Fathom",
        "section": "",
        "mode": "perldoc",
        "summary": "Lingua::EN::Fathom - Measure readability of English text",
        "synopsis": "use Lingua::EN::Fathom;\nmy $text = Lingua::EN::Fathom->new();\n# Analyse contents of a text file\n$text->analysefile(\"sample.txt\"); # Analyse contents of a text file\n$accumulate = 1;\n# Analyse contents of a text string\n$text->analyseblock($textstring,$accumulate);\n# TO Do, remove repetition\n$numchars             = $text->numchars;\n$numwords             = $text->numwords;\n$percentcomplexwords = $text->percentcomplexwords;\n$numsentences         = $text->numsentences;\n$numtextlines        = $text->numtextlines;\n$numblanklines       = $text->numblanklines;\n$numparagraphs        = $text->numparagraphs;\n$syllablesperword    = $text->syllablesperword;\n$wordspersentence    = $text->wordspersentence;\n# comment needed\n%words = $text->uniquewords;\nforeach $word ( sort keys %words )\n{\nprint(\"$words{$word} :$word\\n\");\n}\n$fog     = $text->fog;\n$flesch  = $text->flesch;\n$kincaid = $text->kincaid;\nprint($text->report);",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 35,
                "subsections": []
            },
            {
                "name": "REQUIRES",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 10,
                "subsections": []
            },
            {
                "name": "METHODS",
                "lines": 116,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "POSSIBLE EXTENSIONS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "LIMITATIONS",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "BUGS",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "COPYRIGHT AND LICENSE",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Lingua::EN::Fathom - Measure readability of English text\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use Lingua::EN::Fathom;\n\nmy $text = Lingua::EN::Fathom->new();\n\n# Analyse contents of a text file\n$text->analysefile(\"sample.txt\"); # Analyse contents of a text file\n\n$accumulate = 1;\n# Analyse contents of a text string\n$text->analyseblock($textstring,$accumulate);\n\n# TO Do, remove repetition\n$numchars             = $text->numchars;\n$numwords             = $text->numwords;\n$percentcomplexwords = $text->percentcomplexwords;\n$numsentences         = $text->numsentences;\n$numtextlines        = $text->numtextlines;\n$numblanklines       = $text->numblanklines;\n$numparagraphs        = $text->numparagraphs;\n$syllablesperword    = $text->syllablesperword;\n$wordspersentence    = $text->wordspersentence;\n\n# comment needed\n%words = $text->uniquewords;\nforeach $word ( sort keys %words )\n{\nprint(\"$words{$word} :$word\\n\");\n}\n\n$fog     = $text->fog;\n$flesch  = $text->flesch;\n$kincaid = $text->kincaid;\n\nprint($text->report);\n",
                "subsections": []
            },
            "REQUIRES": {
                "content": "Perl, version 5.001 or higher, Lingua::EN::Syllable\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "This module analyses English text in either a string or file. Totals are then calculated for the\nnumber of characters, words, sentences, blank and non blank (text) lines and paragraphs.\n\nThree common readability statistics are also derived, the Fog, Flesch and Kincaid indices.\n\nAll of these properties can be accessed through individual methods, or by generating a text\nreport.\n\nA hash of all unique words and the number of times they occur is generated.\n",
                "subsections": []
            },
            "METHODS": {
                "content": "new\nThe \"new\" method creates an instance of an text object This must be called before any of the\nfollowing methods are invoked. Note that the object only needs to be created once, and can be\nreused with new input data.\n\nmy $text = Lingua::EN::Fathom->new();\n\nanalysefile\nThe \"analysefile\" method takes as input the name of a text file. Various text based statistics\nare calculated for the file. This method and \"analyseblock\" are prerequisites for all the\nfollowing methods. An optional argument may be supplied to control accumulation of statistics.\nIf set to a non zero value, all statistics are accumulated with each successive call.\n\n$text->analysefile(\"sample.txt\");\n\nanalyseblock\nThe \"analyseblock\" method takes as input a text string. Various text based statistics are\ncalculated for the file. This method and \"analysefile\" are prerequisites for all the following\nmethods. An optional argument may be supplied to control accumulation of statistics. If set to a\nnon zero value, all statistics are accumulated with each successive call.\n\n$text->analyseblock($textstr);\n\nnumchars\nReturns the number of characters in the analysed text file or block. This includes characters\nsuch as spaces, and punctuation marks.\n\nnumwords\nReturns the number of words in the analysed text file or block. A word must consist of letters\na-z with at least one vowel sound, and optionally an apostrophe or hyphen. Items such as \"&,\nK108, NW\" are not counted as words.\n\npercentcomplexwords\nReturns the percentage of complex words in the analysed text file or block. A complex word must\nconsist of three or more syllables. This statistic is used to calculate the fog index.\n\nnumsentences\nReturns the number of sentences in the analysed text file or block. A sentence is any group of\nwords and non words terminated with a single full stop. Spaces may occur before and after the\nfull stop.\n\nnumtextlines\nReturns the number of lines containing some text in the analysed text file or block.\n\nnumblanklines\nReturns the number of lines NOT containing any text in the analysed text file or block.\n\nnumparagraphs\nReturns the number of paragraphs in the analysed text file or block.\n\nsyllablesperword\nReturns the average number of syllables per word in the analysed text file or block.\n\nwordspersentence\nReturns the average number of words per sentence in the analysed text file or block.\n\nREADABILITY\nThree indices of text readability are calculated. They all measure complexity as a function of\nsyllables per word and words per sentence. They assume the text is well formed and logical. You\ncould analyse a passage of nonsensical English and find the readability is quite good, provided\nthe words are not too complex and the sentences not too long.\n\nFor more information see: <http://www.plainlanguage.com/Resources/readability.html>\n\nfog\nReturns the Fog index for the analysed text file or block.\n\n( wordspersentence + percentcomplexwords ) * 0.4\n\nThe Fog index, developed by Robert Gunning, is a well known and simple formula for measuring\nreadability. The index indicates the number of years of formal education a reader of average\nintelligence would need to read the text once and understand that piece of writing with its word\nsentence workload.\n\n18 unreadable\n14 difficult\n12 ideal\n10 acceptable\n8 childish\n\nflesch\nReturns the Flesch reading ease score for the analysed text file or block.\n\n206.835 - (1.015 * wordspersentence) - (84.6 * syllablesperword)\n\nThis score rates text on a 100 point scale. The higher the score, the easier it is to understand\nthe text. A score of 60 to 70 is considered to be optimal.\n\nkincaid\nReturns the Flesch-Kincaid grade level score for the analysed text file or block.\n\n(11.8 * syllablesperword) +  (0.39 * wordspersentence) - 15.59;\n\nThis score rates text on U.S. grade school level. So a score of 8.0 means that the document can\nbe understood by an eighth grader. A score of 7.0 to 8.0 is considered to be optimal.\n\nuniquewords\nReturns a hash of unique words. The words (in lower case) are held in the hash keys while the\nnumber of occurrences are held in the hash values.\n\nreport\nprint($text->report);\n\nProduces a text based report containing all Fathom statistics for the currently analysed text\nblock or file. For example:\n\nNumber of characters : 813 Number of words : 135 Percent of complex words : 20.00 Average\nsyllables per word : 1.7704 Number of sentences : 12 Average words per sentence : 11.2500 Number\nof text lines : 13 Number of blank lines : 8 Number of paragraphs : 4\n\nREADABILITY INDICES\n\nFog : 12.5000 Flesch : 45.6429 Flesch-Kincaid : 9.6879\n\nThe return value is a string containing the report contents\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "Lingua::EN::Syllable,Lingua::EN::Sentence,B::Fathom\n",
                "subsections": []
            },
            "POSSIBLE EXTENSIONS": {
                "content": "Count white space and punctuation characters\nAllow user control over what strictly defines a word\n",
                "subsections": []
            },
            "LIMITATIONS": {
                "content": "The syllable count provided in Lingua::EN::Syllable is about 90% accurate\n\nAcronyms that contain vowels, like GPO, will be counted as words.\n\nThe fog index should exclude proper names\n",
                "subsections": []
            },
            "BUGS": {
                "content": "None known\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Lingua::EN::Fathom was written by Kim Ryan <kimryan at cpan dot org>.\n",
                "subsections": []
            },
            "COPYRIGHT AND LICENSE": {
                "content": "Copyright (c) 2018 Kim Ryan. All rights reserved.\n\nThis library is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself.\n",
                "subsections": []
            }
        }
    }
}