Fix use of path argument in Language.__init__. Needs to be keyword arg, not positional.

This commit is contained in:
Matthew Honnibal 2016-11-23 13:26:34 +01:00
parent a7b5fba132
commit 618ac36093

View File

@ -245,9 +245,10 @@ class Language(object):
yield Trainer(self, gold_tuples) yield Trainer(self, gold_tuples)
self.end_training() self.end_training()
def __init__(self, path=True, **overrides): def __init__(self, **overrides):
if 'data_dir' in overrides and path is True: if 'data_dir' in overrides and overrides.get(path) is True:
raise ValueError("The argument 'data_dir' has been renamed to 'path'") raise ValueError("The argument 'data_dir' has been renamed to 'path'")
path = overrides.get('path')
if isinstance(path, basestring): if isinstance(path, basestring):
path = pathlib.Path(path) path = pathlib.Path(path)
if path is True: if path is True: