Question
Readability measures are used to score the reading difficulty of a text, for the purposes of selecting texts of appropriate difficulty for language learners. Let
Readability measures are used to score the reading difficulty of a text, for the purposes of selecting texts of appropriate difficulty for language learners. Let us define to be the average number of letters per word, and to be the average number of words per sentence, in a given text. The Automated Readability Index (ARI) of the text is defined to be: 4.71+0.521.43 . Write a function readability that computes the ARI score for various sections of the Brown Corpus. The function should take as an arugment a section of the Brown Corpus represented by a letter (e.g. Section F is "popular lore" and Section J is "learned"). Make use of the fact that nltk.corpus.brown.words() produces a sequence of words, while nltk.corpus.brown.sents() produces a sequence of sentences.
It should pass following test def test_readability(self): self.assertAlmostEqual(readability('f'), 10.254756197101155, places=2)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started