Question: data.txt can be left empty. Must use argparse Implement a Python-based English text to Pig-Latin converter. The implementation should read in this text file, data.txt

 data.txt can be left empty. Must use argparse Implement a Python-based

data.txt can be left empty. Must use argparse

Implement a Python-based English text to Pig-Latin converter. The implementation should read in this text file, data.txt , and create a Pig-Latinized output text called out.txt. The converter must implement the following Pig-Latin rules: 1. If a word starts with a consonant and a vowel, put the first letter of the word at the end of the word and add "ay." Example: Happy = appyh + ay = appyhay 2. If a word starts with two consonants move the two consonants to the end of the word and add "ay." Example: Child = Ildch + ay = Ildchay 3. If a word starts with a vowel add the word "way" at the end of the word. Example: Awesome = Awesome +way = Awesomeway 4. The output file must retain all of the punctuations used in the input text file. Coding Requirements 1. The code must use the to input the text file. Optionally, also include an argument for the user to name the output file. An example execution would be: python3 piglatin.py --input data.txt --output data_out.txt 2. The code must include a succinct description of the converter at the top of the file using triple quotes. Put appropriate code comments to promote readability. 3. The code must be modular using two or more functions

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!