Merge pull request #2040 from thomasopsomer/fix-lemma

Make token.lemma property return hash instead of unicode
This commit is contained in:
Matthew Honnibal 2018-02-28 11:35:42 +01:00 committed by GitHub
commit 31dcb4af2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -269,8 +269,8 @@ cdef class Token:
""" """
def __get__(self): def __get__(self):
if self.c.lemma == 0: if self.c.lemma == 0:
lemma = self.vocab.morphology.lemmatizer.lookup(self.orth_) lemma_ = self.vocab.morphology.lemmatizer.lookup(self.orth_)
return lemma return self.vocab.strings[lemma_]
else: else:
return self.c.lemma return self.c.lemma