Skip to content

Commit

Permalink
Fix for missing pos in dictionary.
Browse files Browse the repository at this point in the history
Seems to be "none" although I'm not sure why that would be included
in the xml file...

Well I should remember to do further testing assuming I run it against
the whole file.
  • Loading branch information
gpeterson2 committed Nov 30, 2010
1 parent 831278b commit 05053a7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,13 @@ def parse(self, filename):
sense = Sense();

if tag == 'pos' and action == 'start':
sense.pos.append(pos_dict[elem.text])
try:
pos = pos_dict[elem.text]
except KeyError:
# Shouldn't happen, of course...
pass
#print(elem.text)
sense.pos.append(pos)

if tag == 'gloss' and action == 'start':
gloss = Gloss()
Expand Down

0 comments on commit 05053a7

Please sign in to comment.