Created
April 15, 2016 01:28
-
-
Save kmonsoor/3bc1afc36f5110c696d56e587dd07997 to your computer and use it in GitHub Desktop.
extracting organization names from medical acronyms
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
reader = csv.DictReader(open('c:\Book1.csv')) | |
of = open('out.tsv') | |
writer = csv.writer(of) | |
orgs = ['center of', 'center for', 'commitee for', | |
'commitee of', 'organization', 'ministry of', 'ministry for', | |
'department', ] | |
for row in reader: | |
if any(x in row['Definition'].lower() for x in orgs): | |
# print {row['Acronym']: {'full-form': row['Definition'], 'comment': row['Comments']}} | |
writer.writerow(row['Acronym'], '\t', row['Definition']) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment