* Add warning for models not found in parser

This commit is contained in:
Matthew Honnibal 2015-07-08 20:00:46 +02:00
parent 6218d8b389
commit ef700401a6
1 changed files with 2 additions and 2 deletions

View File

@ -72,9 +72,9 @@ cdef class Parser:
def __init__(self, StringStore strings, model_dir, transition_system): def __init__(self, StringStore strings, model_dir, transition_system):
if not os.path.exists(model_dir): if not os.path.exists(model_dir):
print >> sys.stderr, "Warning: No model found at", model_dir print >> sys.stderr, "Warning: No model found at", model_dir
self.cfg = Config(labels=[], features=[]) self.cfg = Config(labels={}, features=[])
elif not os.path.isdir(model_dir): elif not os.path.isdir(model_dir):
self.cfg = Config(labels=[], features=[]) self.cfg = Config(labels={}, features=[])
print >> sys.stderr, "Warning: model path:", model_dir, "is not a directory" print >> sys.stderr, "Warning: model path:", model_dir, "is not a directory"
else: else:
self.cfg = Config.read(model_dir, 'config') self.cfg = Config.read(model_dir, 'config')