mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-26 01:46:28 +03:00
fix warning numbers
This commit is contained in:
parent
8a79a71190
commit
0fd797e33c
|
@ -219,11 +219,9 @@ class Warnings(metaclass=ErrorsWithCodes):
|
|||
W125 = ("The StaticVectors key_attr is no longer used. To set a custom "
|
||||
"key attribute for vectors, configure it through Vectors(attr=) or "
|
||||
"'spacy init vectors --attr'")
|
||||
W126 = (
|
||||
"Pipe instance '{name}' is being added with a vocab "
|
||||
"instance that will not match other components. This is "
|
||||
"usually an error."
|
||||
)
|
||||
W126 = ("Pipe instance '{name}' is being added with a vocab "
|
||||
"instance that will not match other components. This is "
|
||||
"usually an error.")
|
||||
|
||||
|
||||
class Errors(metaclass=ErrorsWithCodes):
|
||||
|
|
|
@ -2427,7 +2427,7 @@ def _get_instantiated_vocab(
|
|||
elif isinstance(vocab, Vocab):
|
||||
for name, inst_voc in vocab_instances.items():
|
||||
if inst_voc is not vocab:
|
||||
warnings.warn(Warnings.W125.format(name=name))
|
||||
warnings.warn(Warnings.W126.format(name=name))
|
||||
return vocab
|
||||
else:
|
||||
resolved_vocab = None
|
||||
|
@ -2435,7 +2435,7 @@ def _get_instantiated_vocab(
|
|||
if resolved_vocab is None:
|
||||
resolved_vocab = inst_voc
|
||||
elif inst_voc is not resolved_vocab:
|
||||
warnings.warn(Warnings.W125.format(name=name))
|
||||
warnings.warn(Warnings.W126.format(name=name))
|
||||
# This is supposed to only be for the type checker --
|
||||
# it should be unreachable
|
||||
assert resolved_vocab is not None
|
||||
|
|
Loading…
Reference in New Issue
Block a user