From 07776d8096e248637809e45c5d7adbe494c847fd Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Tue, 27 Sep 2016 17:35:58 +0200 Subject: [PATCH] Fix pos name conflict in lemmatize --- spacy/morphology.pyx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spacy/morphology.pyx b/spacy/morphology.pyx index dcb0dfd26..e55fcc155 100644 --- a/spacy/morphology.pyx +++ b/spacy/morphology.pyx @@ -96,15 +96,15 @@ cdef class Morphology: self.tag_map.get(tag_str, {})) self._cache.set(tag_id, orth, cached) - def lemmatize(self, const univ_pos_t pos, attr_t orth, **morphology): + def lemmatize(self, const univ_pos_t univ_pos, attr_t orth, **morphology): cdef unicode py_string = self.strings[orth] if self.lemmatizer is None: return self.strings[py_string.lower()] - if pos != NOUN and pos != VERB and pos != ADJ and pos != PUNCT: + if univ_pos not in (NOUN, VERB, ADJ, PUNCT): return self.strings[py_string.lower()] cdef set lemma_strings cdef unicode lemma_string - lemma_strings = self.lemmatizer(py_string, pos, **morphology) + lemma_strings = self.lemmatizer(py_string, univ_pos, **morphology) lemma_string = sorted(lemma_strings)[0] lemma = self.strings[lemma_string] return lemma