I couldnt find a solution in stackoverflow for replacing based on dictionary where the values are in a list.
Dictionary
dct = {"LOL": ["laught out loud", "laught-out loud"],
"TLDR": ["too long didn't read", "too long; did not read"],
"application": ["app"]}
Input
input_df = pd.DataFrame([("haha too long didn't read and laught out loud :D"),
("laught-out loud so I couldnt too long; did not read"),
("what happened?")], columns=['text'])
Expected output
output_df = pd.DataFrame([("haha TLDR and LOL :D"),
("LOL so I couldnt TLDR"),
("what happened?")], columns=['text'])
Edit
Added a additional entry to the dictionary i.e. "application": ["app"]
The current solutions are giving output as "what happlicationened?"
Please suggest a fix.