-
-
Save shubham769/5348823a652d95335839b8404714c724 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def mapping_replacer(x, dic): | |
for word in dic.keys(): | |
if " " + word + " " in x: | |
x = x.replace(" " + word + " ", " " + dic[word] + " ") | |
return x | |
text = "we aren't able to come ,cause of heavy rain" | |
mapping_replacer(text, contraction) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment