Last active
March 3, 2019 17:01
-
-
Save neelindresh/c806e224d5272108088683c8ecf380bb 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
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