label in span not writable anymore

This commit is contained in:
svlandeg 2019-03-14 16:11:00 +01:00
parent 6e07750dd8
commit ab442338c8
2 changed files with 2 additions and 1 deletions

View File

@ -178,6 +178,7 @@ def test_span_string_label(doc):
assert span.label == doc.vocab.strings["hello"]
@pytest.mark.xfail(reason="label is not writable")
def test_span_string_set_label(doc):
span = Span(doc, 0, 1)
span.label_ = "hello"

View File

@ -653,7 +653,7 @@ cdef class Span:
return self.doc.vocab.strings[self.label]
def __set__(self, unicode label_):
self.label = self.doc.vocab.strings.add(label_)
raise NotImplementedError(TempErrors.T007.format(attr="label_"))
cdef int _count_words_to_root(const TokenC* token, int sent_length) except -1: