mirror of
				https://github.com/explosion/spaCy.git
				synced 2025-11-01 00:17:44 +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, | ||||
| 
 | ||||
|     "LENGTH": LENGTH, | ||||
|     "CLUSTER": CLUSTER, | ||||
|     "LEMMA": LEMMA, | ||||
|     "POS": POS, | ||||
|     "TAG": TAG, | ||||
|  | @ -85,9 +84,7 @@ IDS = { | |||
|     "ENT_KB_ID": ENT_KB_ID, | ||||
|     "HEAD": HEAD, | ||||
|     "SENT_START": SENT_START, | ||||
|     "SENT_END": SENT_END, | ||||
|     "SPACY": SPACY, | ||||
|     "PROB": PROB, | ||||
|     "LANG": LANG, | ||||
|     "MORPH": MORPH, | ||||
|     "IDX": IDX | ||||
|  |  | |||
|  | @ -1,5 +1,5 @@ | |||
| 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 | ||||
| 
 | ||||
| 
 | ||||
|  | @ -30,7 +30,6 @@ def test_vocab_api_shape_attr(en_vocab, text): | |||
|         ("VERB", VERB), | ||||
|         ("LEMMA", LEMMA), | ||||
|         ("ORTH", ORTH), | ||||
|         ("PROB", PROB), | ||||
|     ], | ||||
| ) | ||||
| def test_vocab_api_symbols(en_vocab, string, symbol): | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user