mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 09:26:27 +03:00
Allow lemma to be set from Python. Re #973
This commit is contained in:
parent
137b210bcf
commit
6a4221a6de
|
@ -192,6 +192,8 @@ cdef class Token:
|
||||||
property lemma:
|
property lemma:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return self.c.lemma
|
return self.c.lemma
|
||||||
|
def __set__(self, int lemma):
|
||||||
|
self.c.lemma = lemma
|
||||||
|
|
||||||
property pos:
|
property pos:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
|
@ -570,6 +572,8 @@ cdef class Token:
|
||||||
property lemma_:
|
property lemma_:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
return self.vocab.strings[self.c.lemma]
|
return self.vocab.strings[self.c.lemma]
|
||||||
|
def __set__(self, unicode lemma_):
|
||||||
|
self.c.lemma = self.vocab.strings[lemma_]
|
||||||
|
|
||||||
property pos_:
|
property pos_:
|
||||||
def __get__(self):
|
def __get__(self):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user