Question: Please look at the instructions, the output must match and it must pass the test cases, please read instructions. Provide a sample code with matching
Please look at the instructions, the output must match and it must pass the test cases, please read instructions. Provide a sample code with matching output and passing testn cases.
Creating information files
In this programming problem, you will be writing a program that reads in a text file perhaps containing the contents of a book, poem, article, etc and produces an information file based on the text. You will need to use one or more dictionaries to count words in the program. You may also use lists and or sets.
The information file should contain the following information about the text:
The name of the text file
The total number of words.
The most used small, medium, and large words in the file. For the purposes of this project, the definitions of a small, medium, and large word is:
small: length inclusive.
medium: length inclusive.
large: length inclusive.
The frequencies and percentages for each word length category
The frequencies and percentages for each capitalized word category
The frequencies and percentages for each punctuated word category consider only and
Name your Python file infofile.py
Test Case:
if namemain:
wordlist texttolisttesttxt
assert wordlist two 'forks. 'one', 'knife. 'two', 'glasses.
'one', 'plate. 'one', 'napkin. 'his', 'glasses. 'his', 'knife.
wordcounts countwordswordlist
assert wordcounts two: 'one': 'forks.: 'knife.:
'glasses.: 'plate.: 'napkin.: 'his':
assert mostfrequentwordcountsone 'knife. 'glasses.
assert countcapitalizedwordcounts
assert countpunctuatedwordcounts
assert countsizeswordcounts
writeresultswordcounts, filename
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
