mirror of https://github.com/explosion/spaCy.git
Check for class-defined make_docs method before assigning one provided as an argument
This commit is contained in:
parent
19c1e83d3d
commit
f7fee6c24b
|
@ -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']
|
||||||
|
|
Loading…
Reference in New Issue