mirror of
				https://github.com/explosion/spaCy.git
				synced 2025-11-04 01:48:04 +03:00 
			
		
		
		
	Move error to Errors
This commit is contained in:
		
							parent
							
								
									2748249217
								
							
						
					
					
						commit
						ba22111ff4
					
				| 
						 | 
					@ -483,6 +483,7 @@ class Errors:
 | 
				
			||||||
    E199 = ("Unable to merge 0-length span at doc[{start}:{end}].")
 | 
					    E199 = ("Unable to merge 0-length span at doc[{start}:{end}].")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # TODO: fix numbering after merging develop into master
 | 
					    # TODO: fix numbering after merging develop into master
 | 
				
			||||||
 | 
					    E952 = ("The section '{name}' is not a valid section in the provided config.")
 | 
				
			||||||
    E953 = ("Mismatched IDs received by the Tok2Vec listener: {id1} vs. {id2}")
 | 
					    E953 = ("Mismatched IDs received by the Tok2Vec listener: {id1} vs. {id2}")
 | 
				
			||||||
    E954 = ("The Tok2Vec listener did not receive a valid input.")
 | 
					    E954 = ("The Tok2Vec listener did not receive a valid input.")
 | 
				
			||||||
    E955 = ("Can't find table '{table}' for language '{lang}' in spacy-lookups-data.")
 | 
					    E955 = ("Can't find table '{table}' for language '{lang}' in spacy-lookups-data.")
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1121,9 +1121,8 @@ def dot_to_object(config: Config, section: str):
 | 
				
			||||||
    for item in parts:
 | 
					    for item in parts:
 | 
				
			||||||
        try:
 | 
					        try:
 | 
				
			||||||
            component = component[item]
 | 
					            component = component[item]
 | 
				
			||||||
        except (KeyError, TypeError) as e:
 | 
					        except (KeyError, TypeError):
 | 
				
			||||||
            msg = f"The section '{section}' is not a valid section in the provided config."
 | 
					            raise KeyError(Errors.E952.format(name=section))
 | 
				
			||||||
            raise KeyError(msg)
 | 
					 | 
				
			||||||
    return component
 | 
					    return component
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user