From 9d1b2a103ac32c0a3dee0c01f8c15b0fd2ebc9ce Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Fri, 6 Nov 2015 05:44:35 +1100 Subject: [PATCH] * Fix capitalization in lemmatizer --- spacy/morphology.pyx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spacy/morphology.pyx b/spacy/morphology.pyx index 3d2281ae6..c69488b6c 100644 --- a/spacy/morphology.pyx +++ b/spacy/morphology.pyx @@ -84,11 +84,11 @@ cdef class Morphology: self._cache.set(tag_id, orth, cached) def lemmatize(self, const univ_pos_t pos, attr_t orth): - if self.lemmatizer is None: - return self.strings[orth].lower() 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: - return py_string.lower() + return self.strings[py_string.lower()] cdef set lemma_strings cdef unicode lemma_string lemma_strings = self.lemmatizer(py_string, pos)