Don't raise deprecation warning in property. Closes #1813, #1712

This commit is contained in:
Matthew Honnibal 2018-01-14 14:55:58 +01:00
parent 5081f8a2b4
commit 5cbe913b6f
1 changed files with 8 additions and 7 deletions

View File

@ -341,13 +341,14 @@ cdef class Token:
property sent_start: property sent_start:
def __get__(self): def __get__(self):
util.deprecated( # Raising a deprecation warning causes errors for autocomplete
"Token.sent_start is now deprecated. Use Token.is_sent_start " #util.deprecated(
"instead, which returns a boolean value or None if the answer " # "Token.sent_start is now deprecated. Use Token.is_sent_start "
"is unknown instead of a misleading 0 for False and 1 for " # "instead, which returns a boolean value or None if the answer "
"True. It also fixes a quirk in the old logic that would " # "is unknown instead of a misleading 0 for False and 1 for "
"always set the property to 0 for the first word of the " # "True. It also fixes a quirk in the old logic that would "
"document.") # "always set the property to 0 for the first word of the "
# "document.")
# Handle broken backwards compatibility case: doc[0].sent_start # Handle broken backwards compatibility case: doc[0].sent_start
# was False. # was False.
if self.i == 0: if self.i == 0: