mirror of
				https://github.com/explosion/spaCy.git
				synced 2025-10-31 16:07:41 +03:00 
			
		
		
		
	* Use isort with Black profile * isort all the things * Fix import cycles as a result of import sorting * Add DOCBIN_ALL_ATTRS type definition * Add isort to requirements * Remove isort from build dependencies check * Typo
		
			
				
	
	
		
			27 lines
		
	
	
		
			602 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			602 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| from ..char_classes import (
 | |
|     ALPHA,
 | |
|     ALPHA_LOWER,
 | |
|     ALPHA_UPPER,
 | |
|     CONCAT_QUOTES,
 | |
|     HYPHENS,
 | |
|     LIST_ELLIPSES,
 | |
|     LIST_ICONS,
 | |
| )
 | |
| 
 | |
| _infixes = (
 | |
|     LIST_ELLIPSES
 | |
|     + LIST_ICONS
 | |
|     + [
 | |
|         r"(?<=[0-9])[+\-\*^](?=[0-9-])",
 | |
|         r"(?<=[{al}{q}])\.(?=[{au}{q}])".format(
 | |
|             al=ALPHA_LOWER, au=ALPHA_UPPER, q=CONCAT_QUOTES
 | |
|         ),
 | |
|         r"(?<=[{a}]),(?=[{a}])".format(a=ALPHA),
 | |
|         r"(?<=[{a}0-9])(?:{h})(?=[{a}])".format(a=ALPHA, h=HYPHENS),
 | |
|         r"(?<=[{a}0-9])[:<>=/](?=[{a}])".format(a=ALPHA),
 | |
|     ]
 | |
| )
 | |
| 
 | |
| 
 | |
| TOKENIZER_INFIXES = _infixes
 |