From fd58f7655ac5724864ffbdf68286810f1af7d4d1 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sat, 24 Sep 2016 22:16:43 +0200 Subject: [PATCH] Python 3 compatible basestring --- spacy/language.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/spacy/language.py b/spacy/language.py index 2c7c496b8..1accfe663 100644 --- a/spacy/language.py +++ b/spacy/language.py @@ -9,6 +9,13 @@ except ImportError: import json +try: + basestring +except NameError: + basestring = str + + + from .tokenizer import Tokenizer from .vocab import Vocab from .syntax.parser import Parser @@ -162,7 +169,7 @@ class Language(object): self.entity = entity if entity is not True else defaults.Entity(self.vocab) self.parser = parser if parser is not True else defaults.Parser(self.vocab) self.matcher = matcher if matcher is not True else defaults.Matcher(self.vocab) - self.pipeline = self.pipeline if pipeline is not True else defaults.Pipeline(self) + self.pipeline = pipeline(self) if pipeline is not True else defaults.Pipeline(self) def __reduce__(self): args = (