Question: Task 1 : Modify the textAnalysis.py program to fix the syllable count. fileName = input ( Enter the file name: ) inputFile =

Task 1: Modify the
textAnalysis.py program
to fix the syllable count. fileName = input("Enter the file name: ")
inputFile = open(fileName,' r')
text = inputFile.read()sentences = text.count('.')+ text.count('?')+1 text.count('!')words = len(text.split())syllables =0
vowels = "aeiouAEIOU"
for word in text.split(): syllables += word.count(vowel) if word.endswith(ending): if word.endswith('le'):Compute the Flesch Index and Grade Level
index =206.835-1.015*(words / sentences)-1level = int(round(0.39*(words / sentences)+11.8*\Output the results
print("The Flesch Index is", index)
 Task 1: Modify the textAnalysis.py program to fix the syllable count.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!