mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-12 10:16:27 +03:00
label in span not writable anymore
This commit is contained in:
parent
6e07750dd8
commit
ab442338c8
|
@ -178,6 +178,7 @@ def test_span_string_label(doc):
|
||||||
assert span.label == doc.vocab.strings["hello"]
|
assert span.label == doc.vocab.strings["hello"]
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.xfail(reason="label is not writable")
|
||||||
def test_span_string_set_label(doc):
|
def test_span_string_set_label(doc):
|
||||||
span = Span(doc, 0, 1)
|
span = Span(doc, 0, 1)
|
||||||
span.label_ = "hello"
|
span.label_ = "hello"
|
||||||
|
|
|
@ -653,7 +653,7 @@ cdef class Span:
|
||||||
return self.doc.vocab.strings[self.label]
|
return self.doc.vocab.strings[self.label]
|
||||||
|
|
||||||
def __set__(self, unicode 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:
|
cdef int _count_words_to_root(const TokenC* token, int sent_length) except -1:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user