Create lookups if not passed in

This commit is contained in:
Matthew Honnibal 2019-09-08 18:08:09 +02:00
parent d039ed2267
commit fde4f8ac8e
1 changed files with 2 additions and 0 deletions

View File

@ -39,6 +39,8 @@ from . import about
class BaseDefaults(object):
@classmethod
def create_lemmatizer(cls, nlp=None, lookups=None):
if lookups is None:
lookups = cls.create_lookups(nlp=nlp)
lemma_rules, lemma_index, lemma_exc, lemma_lookup = util.get_lemma_tables(lookups)
return Lemmatizer(lemma_index, lemma_exc, lemma_rules, lemma_lookup)