Remove unsupported attrs from attrs.IDS (#8132)

The attributes `PROB`, `CLUSTER` and `SENT_END` are not supported by
`Lexeme.get_struct_attr` so should not be included through `attrs.IDS`
as supported attributes in `Doc.to_array` and other methods.
This commit is contained in:
Adriane Boyd 2021-06-02 11:16:57 +02:00 committed by GitHub
parent 5aba213349
commit 4aa1a7d5a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 5 deletions

View File

@ -74,7 +74,6 @@ IDS = {
"SUFFIX": SUFFIX, "SUFFIX": SUFFIX,
"LENGTH": LENGTH, "LENGTH": LENGTH,
"CLUSTER": CLUSTER,
"LEMMA": LEMMA, "LEMMA": LEMMA,
"POS": POS, "POS": POS,
"TAG": TAG, "TAG": TAG,
@ -85,9 +84,7 @@ IDS = {
"ENT_KB_ID": ENT_KB_ID, "ENT_KB_ID": ENT_KB_ID,
"HEAD": HEAD, "HEAD": HEAD,
"SENT_START": SENT_START, "SENT_START": SENT_START,
"SENT_END": SENT_END,
"SPACY": SPACY, "SPACY": SPACY,
"PROB": PROB,
"LANG": LANG, "LANG": LANG,
"MORPH": MORPH, "MORPH": MORPH,
"IDX": IDX "IDX": IDX

View File

@ -1,5 +1,5 @@
import pytest import pytest
from spacy.attrs import LEMMA, ORTH, PROB, IS_ALPHA from spacy.attrs import LEMMA, ORTH, IS_ALPHA
from spacy.parts_of_speech import NOUN, VERB from spacy.parts_of_speech import NOUN, VERB
@ -30,7 +30,6 @@ def test_vocab_api_shape_attr(en_vocab, text):
("VERB", VERB), ("VERB", VERB),
("LEMMA", LEMMA), ("LEMMA", LEMMA),
("ORTH", ORTH), ("ORTH", ORTH),
("PROB", PROB),
], ],
) )
def test_vocab_api_symbols(en_vocab, string, symbol): def test_vocab_api_symbols(en_vocab, string, symbol):