Check for class-defined make_docs method before assigning one provided as an argument

This commit is contained in:
Matthew Honnibal 2016-11-02 19:57:13 +01:00
parent 19c1e83d3d
commit f7fee6c24b
1 changed files with 1 additions and 1 deletions

View File

@ -275,7 +275,7 @@ class Language(object):
self.make_doc = overrides['make_doc'] self.make_doc = overrides['make_doc']
elif 'create_make_doc' in overrides: elif 'create_make_doc' in overrides:
self.make_doc = overrides['create_make_doc'](self) self.make_doc = overrides['create_make_doc'](self)
else: elif not hasattr(self, 'make_doc'):
self.make_doc = lambda text: self.tokenizer(text) self.make_doc = lambda text: self.tokenizer(text)
if 'pipeline' in overrides: if 'pipeline' in overrides:
self.pipeline = overrides['pipeline'] self.pipeline = overrides['pipeline']