Skip to content

Instantly share code, notes, and snippets.

@neelindresh
Last active March 3, 2019 17:01
Show Gist options
  • Save neelindresh/c806e224d5272108088683c8ecf380bb to your computer and use it in GitHub Desktop.
Save neelindresh/c806e224d5272108088683c8ecf380bb to your computer and use it in GitHub Desktop.
import json
with open('ShortendText.json','r') as file:
Abbr_dict=json.loads(file.read())
splitLine=line.split()
for i in line.split():
if i in ContractedText.CONTRACTION_MAP:
print(i,ContractedText.CONTRACTION_MAP[i])
splitLine[splitLine.index(i)]=ContractedText.CONTRACTION_MAP[i]
if i in Abbr_dict :
print(i,Abbr_dict[i])
splitLine[splitLine.index(i)]=Abbr_dict[i]
' '.join(splitLine)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment