mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 09:56:28 +03:00
* Create tokenizer via default_tokenizer function
This commit is contained in:
parent
478a8d1829
commit
9bfe20cac9
|
@ -135,6 +135,10 @@ class Language(object):
|
|||
else:
|
||||
return None
|
||||
|
||||
@classmethod
|
||||
def default_tokenizer(cls, package, vocab):
|
||||
return Tokenizer.from_package(package, vocab)
|
||||
|
||||
def __init__(self,
|
||||
data_dir=None,
|
||||
vocab=None,
|
||||
|
@ -178,7 +182,7 @@ class Language(object):
|
|||
vocab = self.default_vocab(package, vectors_package=vectors_package)
|
||||
self.vocab = vocab
|
||||
if tokenizer in (None, True):
|
||||
tokenizer = Tokenizer.from_package(package, self.vocab)
|
||||
tokenizer = self.default_tokenizer(package, self.vocab)
|
||||
self.tokenizer = tokenizer
|
||||
if tagger in (None, True):
|
||||
tagger = Tagger.from_package(package, self.vocab)
|
||||
|
|
Loading…
Reference in New Issue
Block a user