Created
December 1, 2017 10:31
-
-
Save saurabhvyas/bd7dcb4157f1984145c9789d621862bc to your computer and use it in GitHub Desktop.
wiki_resume
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
in_file = "/media/saurabh/New Volume/Untitled Folder/final.txt" | |
out_file = "/media/saurabh/New Volume/Untitled Folder/final_out.txt" | |
replacement = dict([(cp, cp.replace(' ', '_')) for cp in concepts]) | |
with open(in_file) as infile, open(out_file, 'a') as file: | |
for index,line in enumerate(infile): | |
for concept_phrase in concepts: | |
line = line.replace(concept_phrase, replacement[concept_phrase]) | |
file.write(line + '\n' ) | |
if ( index%10000 == 0): | |
print (index) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment