From f7fee6c24b46331af8f2f059e9b2f880d63c9e58 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Wed, 2 Nov 2016 19:57:13 +0100 Subject: [PATCH] Check for class-defined make_docs method before assigning one provided as an argument --- spacy/language.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spacy/language.py b/spacy/language.py index 60f569a64..e373c7ce0 100644 --- a/spacy/language.py +++ b/spacy/language.py @@ -275,7 +275,7 @@ class Language(object): self.make_doc = overrides['make_doc'] elif 'create_make_doc' in overrides: self.make_doc = overrides['create_make_doc'](self) - else: + elif not hasattr(self, 'make_doc'): self.make_doc = lambda text: self.tokenizer(text) if 'pipeline' in overrides: self.pipeline = overrides['pipeline']