From 3814a161e639829df99fe6f36913fced2c3d4e93 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Wed, 11 Oct 2017 08:41:03 +0200 Subject: [PATCH] Avoid clobbering preset lemmas --- spacy/morphology.pyx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spacy/morphology.pyx b/spacy/morphology.pyx index 5a4399698..da9246cb6 100644 --- a/spacy/morphology.pyx +++ b/spacy/morphology.pyx @@ -68,7 +68,8 @@ cdef class Morphology: cdef int assign_untagged(self, TokenC* token) except -1: '''Set morphological attributes on a token without a POS tag.''' - token.lemma = self.lemmatize(0, token.lex.orth, {}) + if token.lemma == 0: + token.lemma = self.lemmatize(0, token.lex.orth, {}) cdef int assign_tag(self, TokenC* token, tag) except -1: if isinstance(tag, basestring):