Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please make it with Python. Include a docstring for your functions. PART A: wordlist contains words. Some of these words contain only letters, other words
please make it with Python.
Include a docstring for your functions. PART A: wordlist contains words. Some of these words contain only letters, other words might contain other characters such as digits, punctuation marks etc. You will read this input file and pluralize only the words that is made up of only letters and will print out the pluralized form of these words in to an output file called pluralWordList.txt. input file: cherry 6s115 python Dr.Java output file: cherries pythons students pennies section01 8Sections student penny Mr Bullock word_list Hello! system The program should include the following functions in a script called doc_module.py isAll Letter: the function takes a String as a parameter and returns true if the string is only made up of letters; otherwise, it returns false. systems 41.67% of the words are pluralized pluralizeWord: the function takes a String as a parameter and returns the plural form of the noun. The function will handle only two rules of pluralization. If the word is ending with "y", the plural form drops the "y" and ends with "ies" (cherry to cherries). In all other cases, "s" is added to the word (for example, orange to oranges) pluralizeAllWords: the function takes an input filename, an output filename, it reads the words in the input file. For each of the words, the method checks whether the words is made up of only letters by calling the method isAllLetter. If the word is made up of all letters, it calls the pluralizeWord method with the word as a parameter to get the plural form. Then it writes the plural form of the word into the output file. The function will find and write the percentage of the words that are pluralized to the end of the output file. PART B: Write a script, yourname_doc.py that calls pluralizeAllWords function to pluralize the words in 'wordList.txt and create a new file for the successfully pluralized words as 'pluralWordList.txt.
Step by Step Solution
★★★★★
3.41 Rating (164 Votes )
There are 3 Steps involved in it
Step: 1
Question Code for docmodulepy def is AllLetterstr This functio...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