Skip to content

Commit

Permalink
Merge pull request #50 from johnb30/errors
Browse files Browse the repository at this point in the history
Errors
  • Loading branch information
johnb30 committed Jun 18, 2014
2 parents 03bb928 + 0a47d1e commit 239599b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48221,7 +48221,7 @@ UKRAINE_
+DONETS_BASIN_
+DONBASS_
+DONBAS_
[USRUKR >910824]
[USRUKR <910824]
[UKRUNR 910824-911221]
[UKR >911221]
LEONID_KRAVCHUK_ ; CountryInfo.txt
Expand Down
12 changes: 9 additions & 3 deletions petrarch/petrarch.py
Original file line number Diff line number Diff line change
Expand Up @@ -1315,6 +1315,7 @@ def make_multi_sequences(multilist, verbloc, endtag):

global ParseList, ParseStart

logger = logging.getLogger('petr_log')
ka = 1
if multilist[0]: # words follow the verb
kword = verbloc + 1
Expand Down Expand Up @@ -2524,6 +2525,7 @@ def code_record():
# code triples that were produced; this is set in make_event_strings
CodedEvents = []

logger = logging.getLogger('petr_log')
try:
check_commas()
except SkipRecord:
Expand All @@ -2536,7 +2538,11 @@ def code_record():
if ShowParseList:
print('code_rec-Parselist::', ParseList)

check_verbs()
try:
check_verbs()
except IndexError:
logger.warning('\tIndexError in parsing. Probably a bad sentence.')
print('\tIndexError in parsing. Probably a bad sentence.')

if len(CodedEvents) > 0:
return CodedEvents
Expand Down Expand Up @@ -2604,11 +2610,11 @@ def do_validation(filepath):
print("Exiting: parsing error ")
PETRreader.close_FIN()
sys.exit()

PETRreader.close_FIN()
print("Normal exit from validation\nRecords coded correctly:", nvalid)
sys.exit()


def do_coding(event_dict, out_file):
"""
Expand Down

0 comments on commit 239599b

Please sign in to comment.