Avoid clobbering preset lemmas

This commit is contained in:
Matthew Honnibal 2017-11-05 19:39:38 +01:00
parent 6f438b17c1
commit bb25cb0f76

View File

@ -109,7 +109,8 @@ cdef class Morphology:
analysis.lemma = self.lemmatize(analysis.tag.pos, token.lex.orth,
self.tag_map.get(tag_str, {}))
self._cache.set(tag_id, token.lex.orth, analysis)
token.lemma = analysis.lemma
if token.lemma == 0:
token.lemma = analysis.lemma
token.pos = analysis.tag.pos
token.tag = analysis.tag.name
token.morph = analysis.tag.morph