From 2d9e5bf566be7a9a6706d1ef2b01f63a2bde7f2e Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Fri, 9 Oct 2015 19:02:42 +1100 Subject: [PATCH] * Allow punctuation to be lemmatized --- spacy/morphology.pyx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spacy/morphology.pyx b/spacy/morphology.pyx index 1a499aa0a..534f64a59 100644 --- a/spacy/morphology.pyx +++ b/spacy/morphology.pyx @@ -7,7 +7,7 @@ except ImportError: import json from .parts_of_speech import UNIV_POS_NAMES -from .parts_of_speech cimport ADJ, VERB, NOUN +from .parts_of_speech cimport ADJ, VERB, NOUN, PUNCT cdef class Morphology: @@ -81,7 +81,7 @@ cdef class Morphology: if self.lemmatizer is None: return orth cdef unicode py_string = self.strings[orth] - if pos != NOUN and pos != VERB and pos != ADJ: + if pos != NOUN and pos != VERB and pos != ADJ and pos != PUNCT: return orth cdef set lemma_strings cdef unicode lemma_string