Fix create_tokenizer when nlp is None

This commit is contained in:
Matthew Honnibal 2016-11-26 12:36:04 +01:00
parent a335c6dcc2
commit 1f6c37c6f5

View File

@ -80,7 +80,7 @@ class BaseDefaults(object):
else: else:
infix_finditer = None infix_finditer = None
vocab = nlp.vocab if nlp is not None else cls.create_vocab(nlp) vocab = nlp.vocab if nlp is not None else cls.create_vocab(nlp)
return Tokenizer(nlp.vocab, rules=rules, return Tokenizer(vocab, rules=rules,
prefix_search=prefix_search, suffix_search=suffix_search, prefix_search=prefix_search, suffix_search=suffix_search,
infix_finditer=infix_finditer) infix_finditer=infix_finditer)