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

View File

@ -39,6 +39,8 @@ from . import about
class BaseDefaults(object): class BaseDefaults(object):
@classmethod @classmethod
def create_lemmatizer(cls, nlp=None, lookups=None): 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) lemma_rules, lemma_index, lemma_exc, lemma_lookup = util.get_lemma_tables(lookups)
return Lemmatizer(lemma_index, lemma_exc, lemma_rules, lemma_lookup) return Lemmatizer(lemma_index, lemma_exc, lemma_rules, lemma_lookup)