mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 17:36:30 +03:00
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:
parent
5aba213349
commit
4aa1a7d5a3
|
@ -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
|
||||||
|
|
|
@ -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):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user