mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 18:06:29 +03:00
Create lookups if not passed in
This commit is contained in:
parent
d039ed2267
commit
fde4f8ac8e
|
@ -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)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user