Update fix for Issue #999

This commit is contained in:
Matthew Honnibal 2017-04-23 18:14:37 +02:00
parent 874a3cbb07
commit d2436dc17b

View File

@ -146,7 +146,7 @@ cdef class Parser:
if 'labels' in cfg and 'actions' not in cfg:
cfg['actions'] = cfg.pop('labels')
# TODO: remove this shim when we don't have to support older data
for action_name, labels in dict(cfg['actions']).items():
for action_name, labels in dict(cfg.get('actions', {})).items():
# We need this to be sorted
if isinstance(labels, dict):
labels = list(sorted(labels.keys()))