mirror of
https://github.com/explosion/spaCy.git
synced 2025-08-02 11:20:19 +03:00
Merge upstream master into PR branch
This commit is contained in:
parent
953b6908d6
commit
0f20918008
|
@ -198,22 +198,22 @@ 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.E1047.format(label=label))
|
||||
if search_chars is not None and len(search_chars) > 63:
|
||||
raise ValueError(Errors.E1048.format(label=label))
|
||||
if search_chars is not None and len(search_chars) > 63:
|
||||
raise ValueError(Errors.E1049.format(label=label))
|
||||
if lengths is None or rows is None:
|
||||
raise ValueError(Errors.E1047.format(label=label))
|
||||
raise ValueError(Errors.E1048.format(label=label))
|
||||
if len(lengths) != len(rows):
|
||||
raise ValueError(Errors.E1047.format(label=label))
|
||||
raise ValueError(Errors.E1048.format(label=label))
|
||||
if any([length < 1 for length in lengths]):
|
||||
raise ValueError(Errors.E1047.format(label=label))
|
||||
raise ValueError(Errors.E1048.format(label=label))
|
||||
elif search_chars is not None:
|
||||
raise ValueError(Errors.E1047.format(label=label))
|
||||
raise ValueError(Errors.E1048.format(label=label))
|
||||
if lengths is not None:
|
||||
if lengths[-1] > 63:
|
||||
raise ValueError(Errors.E1048.format(label=label))
|
||||
if len(lengths) != len(set(lengths)) or lengths != sorted(lengths):
|
||||
raise ValueError(Errors.E1049.format(label=label))
|
||||
if len(lengths) != len(set(lengths)) or lengths != sorted(lengths):
|
||||
raise ValueError(Errors.E1050.format(label=label))
|
||||
|
||||
|
||||
@registry.architectures("spacy.RichMultiHashEmbed.v1")
|
||||
|
|
|
@ -1768,7 +1768,7 @@ def get_search_char_byte_arrays(
|
|||
):
|
||||
this_width = idx - working_start
|
||||
if this_width > 4 or this_width < working_width:
|
||||
raise RuntimeError(Errors.E1050)
|
||||
raise RuntimeError(Errors.E1051)
|
||||
if this_width > working_width:
|
||||
for i in range(working_width, 5):
|
||||
width_offsets[i] = working_start
|
||||
|
|
Loading…
Reference in New Issue
Block a user