# Buggy code
def __call__(self, string, univ_pos, morphology=None):
    lookup_table = self.lookups.get_table("lemma_lookup", {})
    if "lemma_rules" not in self.lookups:
        return [lookup_table.get(string, string)]
    if univ_pos in (NOUN, "NOUN", "noun"):
        univ_pos = "noun"
    elif univ_pos in (VERB, "VERB", "verb"):
        univ_pos = "verb"
    elif univ_pos in (ADJ, "ADJ", "adj"):
        univ_pos = "adj"
    elif univ_pos in (ADP, "ADP", "adp"):
        univ_pos = "adp"
    elif univ_pos in (ADV, "ADV", "adv"):
        univ_pos = "adv"
    elif univ_pos in (AUX, "AUX", "aux"):
        univ_pos = "aux"
    elif univ_pos in (CCONJ, "CCONJ", "cconj"):
        univ_pos = "cconj"
    elif univ_pos in (DET, "DET", "det"):
        univ_pos = "det"
    elif univ_pos in (PRON, "PRON", "pron"):
        univ_pos = "pron"
    elif univ_pos in (PUNCT, "PUNCT", "punct"):
        univ_pos = "punct"
    elif univ_pos in (SCONJ, "SCONJ", "sconj"):
        univ_pos = "sconj"
    else:
        return [self.lookup(string)]
    # See Issue #435 for example of where this logic is requied.
    if self.is_base_form(univ_pos, morphology):
        return list(set([string.lower()]))
    index_table = self.lookups.get_table("lemma_index", {})
    exc_table = self.lookups.get_table("lemma_exc", {})
    rules_table = self.lookups.get_table("lemma_rules", {})
    lemmas = self.lemmatize(
        string,
        index_table.get(univ_pos, {}),
        exc_table.get(univ_pos, {}),
        rules_table.get(univ_pos, []),
    )
    return lemmas


# Traceback (TypeError)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
in
2 nlp = spacy.load("fr_core_news_sm")
3
----> 4 doc = nlp("C'est une phrase.")
5 print([(w.text, w.pos_) for w in doc])

~/anaconda3/lib/python3.7/site-packages/spacy/language.py in __call__(self, text, disable, component_cfg)
447             if not hasattr(proc, "__call__"):
448                 raise ValueError(Errors.E003.format(component=type(proc), name=name))
--> 449             doc = proc(doc, **component_cfg.get(name, {}))
450             if doc is None:
451                 raise ValueError(Errors.E005.format(name=name))

pipes.pyx in spacy.pipeline.pipes.Tagger.__call__()

pipes.pyx in spacy.pipeline.pipes.Tagger.set_annotations()

morphology.pyx in spacy.morphology.Morphology.assign_tag_id()

morphology.pyx in spacy.morphology.Morphology.lemmatize()

~/anaconda3/lib/python3.7/site-packages/spacy/lang/fr/lemmatizer.py in __call__(self, string, univ_pos, morphology)
47             return [self.lookup(string)]
48         # See Issue #435 for example of where this logic is requied.
---> 49         if self.is_base_form(univ_pos, morphology):
50             return list(set([string.lower()]))
51         index_table = self.lookups.get_table("lemma_index", {})

TypeError: 'NoneType' object is not callable

# Fixed code
def __call__(self, string, univ_pos, morphology=None):
    lookup_table = self.lookups.get_table("lemma_lookup", {})
    if "lemma_rules" not in self.lookups:
        return [lookup_table.get(string, string)]
    if univ_pos in (NOUN, "NOUN", "noun"):
        univ_pos = "noun"
    elif univ_pos in (VERB, "VERB", "verb"):
        univ_pos = "verb"
    elif univ_pos in (ADJ, "ADJ", "adj"):
        univ_pos = "adj"
    elif univ_pos in (ADP, "ADP", "adp"):
        univ_pos = "adp"
    elif univ_pos in (ADV, "ADV", "adv"):
        univ_pos = "adv"
    elif univ_pos in (AUX, "AUX", "aux"):
        univ_pos = "aux"
    elif univ_pos in (CCONJ, "CCONJ", "cconj"):
        univ_pos = "cconj"
    elif univ_pos in (DET, "DET", "det"):
        univ_pos = "det"
    elif univ_pos in (PRON, "PRON", "pron"):
        univ_pos = "pron"
    elif univ_pos in (PUNCT, "PUNCT", "punct"):
        univ_pos = "punct"
    elif univ_pos in (SCONJ, "SCONJ", "sconj"):
        univ_pos = "sconj"
    else:
        return [self.lookup(string)]
    index_table = self.lookups.get_table("lemma_index", {})
    exc_table = self.lookups.get_table("lemma_exc", {})
    rules_table = self.lookups.get_table("lemma_rules", {})
    lemmas = self.lemmatize(
        string,
        index_table.get(univ_pos, {}),
        exc_table.get(univ_pos, {}),
        rules_table.get(univ_pos, []),
    )
    return lemmas