* Add Token.sent_start property, re Issue #235

This commit is contained in:
Matthew Honnibal 2016-05-05 11:53:20 +02:00
parent 4917cbb484
commit 01e59e4e6e

View File

@ -279,6 +279,18 @@ cdef class Token:
def __get__(self):
return self.c.r_kids
property sent_start:
def __get__(self):
return self.c.sent_start
def __set__(self, bint value):
if self.doc.is_parsed:
raise ValueError(
'Refusing to write to token.sent_start if its document is parsed, '
'because this may cause inconsistent state. '
'See https://github.com/spacy-io/spaCy/issues/235 for workarounds.')
self.c.sent_start = value
property lefts:
def __get__(self):
"""