mirror of
https://github.com/explosion/spaCy.git
synced 2025-08-02 11:20:19 +03:00
Fix error codes
This commit is contained in:
parent
34e8bc620d
commit
100d66a052
|
@ -952,8 +952,7 @@ class Errors(metaclass=ErrorsWithCodes):
|
|||
"sure it's overwritten on the subclass.")
|
||||
E1046 = ("{cls_name} is an abstract class and cannot be instantiated. If you are looking for spaCy's default "
|
||||
"knowledge base, use `InMemoryLookupKB`.")
|
||||
E1047 = ("Search characters for '{label}' may not contain upper-case chars where case_sensitive==False.")
|
||||
E1048 = ("Invalid rich group config '{label}'.")
|
||||
E1047 = ("Invalid rich group config '{label}'.")
|
||||
|
||||
|
||||
# Deprecated model shortcuts, only used in errors and warnings
|
||||
|
|
|
@ -198,21 +198,15 @@ def _verify_rich_config_group(
|
|||
) -> None:
|
||||
if lengths is not None or rows is not None:
|
||||
if is_search_char_group and (search_chars is None or len(search_chars) == 0):
|
||||
raise ValueError(Errors.E1045.format(label=label))
|
||||
raise ValueError(Errors.E1047.format(label=label))
|
||||
if lengths is None or rows is None:
|
||||
raise ValueError(Errors.E1045.format(label=label))
|
||||
raise ValueError(Errors.E1047.format(label=label))
|
||||
if len(lengths) != len(rows):
|
||||
raise ValueError(Errors.E1045.format(label=label))
|
||||
raise ValueError(Errors.E1047.format(label=label))
|
||||
if any([length < 1 for length in lengths]):
|
||||
raise ValueError(Errors.E1045.format(label=label))
|
||||
if (
|
||||
not case_sensitive
|
||||
and search_chars is not None
|
||||
and search_chars != search_chars.lower()
|
||||
):
|
||||
raise ValueError(Errors.E1044.format(label=label))
|
||||
raise ValueError(Errors.E1047.format(label=label))
|
||||
elif search_chars is not None:
|
||||
raise ValueError(Errors.E1045.format(label=label))
|
||||
raise ValueError(Errors.E1047.format(label=label))
|
||||
|
||||
|
||||
@registry.architectures("spacy.RichMultiHashEmbed.v1")
|
||||
|
|
Loading…
Reference in New Issue
Block a user