Question
#python Write a function called pigitize that takes one parameter: infile - A file name of type string. This input file is meant for reading.
#python Write a function called pigitize that takes one parameter: infile - A file name of type string. This input file is meant for reading. The function takes the English text from the file, translates it into Pig Latin, and prints the translated text out to the screen. The rules of Pig Latin that we will be using for this assignment are as follows (source: https://en.wikipedia.org/wiki/Pig_Latin): For words that begin with consonant sounds, all letters before the initial vowel are placed at the end of the word sequence. Then, "ay" (some people just add "a") is added, as in the following examples:
"pig" "igpay" "banana" "ananabay" "trash" "ashtray" "happy" "appyhay" "duck" "uckday" "glove" "oveglay" For words that begin with vowel sounds or a silent letter, one just adds "yay" to the end. Examples are: "eat" "eatyay" "omelet" "omeletyay" "are" "areyay" The output must keep the file's linebreaks in tact. Uppercase characters and punctuation must also be taken into account. For example, if the file test.txt contains the following text: Hello! My name is example. exampleyay It is a pleasure to meet you. The output of function call pigitize( "test.txt" ) should be: ellohay ymay amenay isyay exampleyay ityay isyay ayay easureplay otay eetmay ouyay Hint - Try making little functions to do some of the smaller jobs of this program. Breaking up the problem into pieces is easier than having one function do everything.
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