Avoid clobbering existing lemmas

This commit is contained in:
Matthew Honnibal 2017-10-11 03:33:06 -05:00
parent 807e109f2b
commit 17c467e0ab
1 changed files with 3 additions and 2 deletions

View File

@ -68,6 +68,7 @@ cdef class Morphology:
cdef int assign_untagged(self, TokenC* token) except -1: cdef int assign_untagged(self, TokenC* token) except -1:
'''Set morphological attributes on a token without a POS tag.''' '''Set morphological attributes on a token without a POS tag.'''
if token.lemma == 0:
token.lemma = self.lemmatize(0, token.lex.orth, {}) token.lemma = self.lemmatize(0, token.lex.orth, {})
cdef int assign_tag(self, TokenC* token, tag) except -1: cdef int assign_tag(self, TokenC* token, tag) except -1: