From 6a4221a6decd92d7656c139f4b297095f3ab4158 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Sun, 16 Apr 2017 18:07:53 +0200 Subject: [PATCH] Allow lemma to be set from Python. Re #973 --- spacy/tokens/token.pyx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spacy/tokens/token.pyx b/spacy/tokens/token.pyx index 94491614c..f146f5cd6 100644 --- a/spacy/tokens/token.pyx +++ b/spacy/tokens/token.pyx @@ -192,6 +192,8 @@ cdef class Token: property lemma: def __get__(self): return self.c.lemma + def __set__(self, int lemma): + self.c.lemma = lemma property pos: def __get__(self): @@ -570,6 +572,8 @@ cdef class Token: property lemma_: def __get__(self): return self.vocab.strings[self.c.lemma] + def __set__(self, unicode lemma_): + self.c.lemma = self.vocab.strings[lemma_] property pos_: def __get__(self):