In this assignment, you are writing a program that converts common texting abbreviations to English words to

Question:

In this assignment, you are writing a program that converts common texting abbreviations to English words to allow people like yours truly can understand.
For the assignment, you are provided with a .txt file, called TextroEnglish.txt, that provides the abbreviations and their English translation. The file contains G-Rated translations only. The txt file has comma separated values that list the key as the first item, a comma to separate the key from the value, and then the value.
For this assignment, you need to submit one file called Assignment 10_LastName.py, where Last Name is your last name. Please include comments in your code that explain what your code is doing. The comments should also include your name, recitation TA, and the assignment number. Each function should be commented with the functions purpose and description of the parameters.
Steps:
1. Write a function, called CreateDictionary that is given the name of the text file to be read. The function opens the given file, reads in data, and generates a dictionary. The dictionary key is the text abbreviation and the value is the English translation. For example. one entry in your dictionary will be, 'I8': 'late' because one of the rows in the txt file contains '18' and 'late'.
Your function should have one input: the name of the file to open, and one return value: the dictionary. Test your function before moving on to the next step. You can do this by defining the function and then calling it In your.py file:
wordDlctionary = CreateDictionary(filename)
2. Write a function Deslang(..) that takes two parameters, a string and a dictionary, and returns the deslanged string. Each word in the string will be replaced if it has an entry in the dictionary. Any word not in the dictionary should be copied to the results.
deslanged = Deslang(slang, wordDictionary)
For example, if tic Slang string is: "David, y r u 18"
your function should return: "David, why are you late"
3. Your main function in the .py file containing your functions, CreateDictionary, and Deslong, should do the following:
a. Call the CreateDictionary function.
b. Prompt the user for a text abbreviation and check if it is in the dictionary. If it is, print the English words associated with the abbreviation, otherwise print "Not Found".
Your main must also allow the user to continue inputting abbreviations and printing the English meaning of those abbreviations until the user enters 'quit'.
c. Prompt the user for an arbitrary number of text abbreviations, separated by a space, and print a string that displays the meaning of all abbreviations (by calling the Deslang function).
Your main must also allow the user to continue inputting sentences with abbreviations and printing the English meaning of those sentences without abbreviations until the user enters "quit".
For this assignment, will be testing your code by importing your code into our own .py files and calling your functions. We will not use your main function. Therefore, your functions for CreateDictionasy and Deslang should not produce any output or require any input from user. You can test this by creating another .py file that imports your assignment into it and has Its own main function that calls your required functions.
$$,money
/.,SlashdOt
•4u,Kiss for
•67,unknovn
•eg•,ovil grin
Oday , software illegally obtained before it was released
Onoe, oh no
Over, over
10q,thank you
10tacle, Tentacle
10x, thanks
12b, wannabe
1337,elite
133t, ellts
143, I love you
187, murder
1ab, wannabe
1daful, wonderful
1dering, wondering
1nce, once
1aec, one second
2, too
2b, to be
2b4u, too bad for you
2bad4u2, too bad for you too
2bh, to be honest
2da, to the
2dae, today
2day, today
2ditd, today is the day
2ez, too easy
2q2b4q, to good to be forgotten
2q2bt, too good to be true
2qe4, Together
2qetha, together
2qether, together
2qothr, together
2qotr, Together
2h2h, too hot to handle
2h4u, too hot for you
2k0, 2000
2k1, 2001
2k4, 2004
2k6, 2006
2k7, 2007
2k8, 2008
2k9, 2009
218, too late
2m, tomorrow
2m4u, too much for you
2ma, Tomorrow
2maro, tomorrow
2mmrw, tomorrow
2mo, tomorrow
2mora, tomorrow
2moro, tomorrow
2morow, tomorrow
Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: