mirror of
				https://github.com/explosion/spaCy.git
				synced 2025-11-04 09:57:26 +03:00 
			
		
		
		
	Update subset/superset docs (#8795)
* Update subset/superset docs * Update website/docs/usage/rule-based-matching.md Co-authored-by: Adriane Boyd <adrianeboyd@gmail.com> Co-authored-by: Adriane Boyd <adrianeboyd@gmail.com>
This commit is contained in:
		
							parent
							
								
									cf3855ae05
								
							
						
					
					
						commit
						de5bc8a0e1
					
				| 
						 | 
					@ -232,14 +232,20 @@ following rich comparison attributes are available:
 | 
				
			||||||
>
 | 
					>
 | 
				
			||||||
> # Matches tokens of length >= 10
 | 
					> # Matches tokens of length >= 10
 | 
				
			||||||
> pattern2 = [{"LENGTH": {">=": 10}}]
 | 
					> pattern2 = [{"LENGTH": {">=": 10}}]
 | 
				
			||||||
 | 
					>
 | 
				
			||||||
 | 
					> # Match based on morph attributes
 | 
				
			||||||
 | 
					> pattern3 = [{"MORPH": {"IS_SUBSET": ["Number=Sing", "Gender=Neut"]}}]
 | 
				
			||||||
 | 
					> # "", "Number=Sing" and "Number=Sing|Gender=Neut" will match as subsets
 | 
				
			||||||
 | 
					> # "Number=Plur|Gender=Neut" will not match
 | 
				
			||||||
 | 
					> # "Number=Sing|Gender=Neut|Polite=Infm" will not match because it's a superset
 | 
				
			||||||
> ```
 | 
					> ```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| Attribute                  | Description                                                                                             |
 | 
					| Attribute                  | Description                                                                                             |
 | 
				
			||||||
| -------------------------- | ------------------------------------------------------------------------------------------------------- |
 | 
					| -------------------------- | ------------------------------------------------------------------------------------------------------- |
 | 
				
			||||||
| `IN`                       | Attribute value is member of a list. ~~Any~~                                                            |
 | 
					| `IN`                       | Attribute value is member of a list. ~~Any~~                                                            |
 | 
				
			||||||
| `NOT_IN`                   | Attribute value is _not_ member of a list. ~~Any~~                                                      |
 | 
					| `NOT_IN`                   | Attribute value is _not_ member of a list. ~~Any~~                                                      |
 | 
				
			||||||
| `ISSUBSET`                 | Attribute values (for `MORPH`) are a subset of a list. ~~Any~~                                          |
 | 
					| `IS_SUBSET`                | Attribute values (for `MORPH`) are a subset of a list. ~~Any~~                                          |
 | 
				
			||||||
| `ISSUPERSET`               | Attribute values (for `MORPH`) are a superset of a list. ~~Any~~                                        |
 | 
					| `IS_SUPERSET`              | Attribute values (for `MORPH`) are a superset of a list. ~~Any~~                                        |
 | 
				
			||||||
| `==`, `>=`, `<=`, `>`, `<` | Attribute value is equal, greater or equal, smaller or equal, greater or smaller. ~~Union[int, float]~~ |
 | 
					| `==`, `>=`, `<=`, `>`, `<` | Attribute value is equal, greater or equal, smaller or equal, greater or smaller. ~~Union[int, float]~~ |
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#### Regular expressions {#regex new="2.1"}
 | 
					#### Regular expressions {#regex new="2.1"}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user