Skip to content

Commit

Permalink
Merge pull request #41 from CMPUT291F18MP2/ryfurrer-patch-2
Browse files Browse the repository at this point in the history
Update phase1.py
  • Loading branch information
ryfurrer committed Nov 26, 2018
2 parents 88efe8c + 4baaae2 commit 1abc677
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions mini_project_2/phase1.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@ def write_terms(root, f):
aid = root.find('aid').text

title = root.find('ti').text
title = title.lower().split(' ')
if title:
title = title.lower().split(' ')
for word in title:
for match in re.findall(pattern, word):
terms.append(match + ":" + aid + '\n')

desc = root.find('desc').text
desc = desc.lower().split(' ')

for word in title:
for match in re.findall(pattern, word):
terms.append(match + ":" + aid + '\n')

for word in desc:
for match in re.findall(pattern, word):
terms.append(match + ":" + aid + '\n')
if desc:
desc = desc.lower().split(' ')
for word in desc:
for match in re.findall(pattern, word):
terms.append(match + ":" + aid + '\n')

for term in terms:
f.write(term)
Expand Down

0 comments on commit 1abc677

Please sign in to comment.