mirror of
				https://github.com/explosion/spaCy.git
				synced 2025-11-04 09:57:26 +03:00 
			
		
		
		
	Fix int value handling in Matcher (#4749)
Add `int` values (for `LENGTH`) in _get_attr_values() instead of treating `int` like `dict`.
This commit is contained in:
		
							parent
							
								
									ab8dc2732c
								
							
						
					
					
						commit
						c208eb6e4d
					
				| 
						 | 
					@ -677,7 +677,9 @@ def _get_attr_values(spec, string_store):
 | 
				
			||||||
            value = string_store.add(value)
 | 
					            value = string_store.add(value)
 | 
				
			||||||
        elif isinstance(value, bool):
 | 
					        elif isinstance(value, bool):
 | 
				
			||||||
            value = int(value)
 | 
					            value = int(value)
 | 
				
			||||||
        elif isinstance(value, (dict, int)):
 | 
					        elif isinstance(value, int):
 | 
				
			||||||
 | 
					            pass
 | 
				
			||||||
 | 
					        elif isinstance(value, dict):
 | 
				
			||||||
            continue
 | 
					            continue
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            raise ValueError(Errors.E153.format(vtype=type(value).__name__))
 | 
					            raise ValueError(Errors.E153.format(vtype=type(value).__name__))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user