Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This must be in Python! You are to create a decoder program that takes a tweet as input and turns it into an English sentence.

This must be in Python! You are to create a decoder program that takes a tweet as input and turns it into an English sentence. A tweet will contain common acronyms and abbreviations, and your program will need to have a way to decode them (dictionary). For example) lol => laughing out loud, brb => be right back Provided is a file with common tweet abbreviations and associated meanings, your program is to use this csv file (tweet_decoder.csv) to create its dictionary.

1. Start by creating a framework for the program that contains a dictionary with a few abbreviations such as decoder = {brb: be right back, b4: before, }

2. Ask for a user to input a tweet.

3. Lookup abbreviations within the tweet, decode and replace them.

4. Print out the decoded string.

5. Offer the option to run again.

6. Your program will need to open up the tweet_decoder.csv file. Make sure that this file is copied into the same directory where your python file is saved.

7. Review the lecture slides as a reference.

8. Each line of the CSV file represents a key and a value pair These needs to be added to the dictionary.

The CSV is an excel file with the words included: 2DAY = Today 4EAE = For ever and ever ADN = Any day now AFAIK = As far as I know AFK = Away from keyboard ATM = At the moment BC = Because B4 = Before BFN = Bye for now BOL = Be on later BRB = Be right back BTW = By the way DM = Direct message FTF = Face to face F2F = Face to face FB = Facebook FWIW = For what it is worth FYEO = For your eyes only FYI = For your information GR8 = Great HAK = Hugs and kisses HAND = Have a nice day IMHO = In my honest opinion IMO = In my opinion IU2U = It is up to you IYKWIM = If you know what I mean J/K = Just kidding J4F = Just for fun JIC = Just in case JSYK = Just so you know L8R = Later LMK = Let me know LOL = Laughing out loud MSM = Mainstream media NAGI = Not a great idea NM = Never mind NP = No problem NSFW = Not safe for work NSFL = Note safe for life NTS = Note to self OH = Overheard OMG = Oh my God PAW = Parents are watching PLS = Please PLZ = Please PPL = People PTB = Please text back RL = Real life ROFL = Rolling on the floor laughing RUOK = Are you okay? SMH = Shaking my head SRSLY = Seriously SSDD = Same stuff, different day SWAK = Sealed with a kiss SWYP = So, what is your problem? TIA = Thanks in advance TIME = Tears in my eyes TMB = Tweet me back TMI = Too much information TMRW = Tomorrow TTYL = Talk to you later TY = Thank you TU = Thank you VSF = Very sad face WB = Welcome back WTH = What the heck? WTPA = Where the party at? WYCM = Will you call me? YLM = You love me? YW = You are welcome

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application Development And Administration

Authors: Michael V. Mannino

4th Edition

0615231047, 978-0615231044

More Books

Students also viewed these Databases questions

Question

=+j Explain the essential nature of repatriation.

Answered: 1 week ago