mirror of https://github.com/explosion/spaCy.git
Python 3 compatible basestring
This commit is contained in:
parent
082e95b19e
commit
fd58f7655a
|
@ -9,6 +9,13 @@ except ImportError:
|
||||||
import json
|
import json
|
||||||
|
|
||||||
|
|
||||||
|
try:
|
||||||
|
basestring
|
||||||
|
except NameError:
|
||||||
|
basestring = str
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
from .tokenizer import Tokenizer
|
from .tokenizer import Tokenizer
|
||||||
from .vocab import Vocab
|
from .vocab import Vocab
|
||||||
from .syntax.parser import Parser
|
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.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.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.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):
|
def __reduce__(self):
|
||||||
args = (
|
args = (
|
||||||
|
|
Loading…
Reference in New Issue