mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-13 18:56:36 +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 "
|
W125 = ("The StaticVectors key_attr is no longer used. To set a custom "
|
||||||
"key attribute for vectors, configure it through Vectors(attr=) or "
|
"key attribute for vectors, configure it through Vectors(attr=) or "
|
||||||
"'spacy init vectors --attr'")
|
"'spacy init vectors --attr'")
|
||||||
W126 = (
|
W126 = ("Pipe instance '{name}' is being added with a vocab "
|
||||||
"Pipe instance '{name}' is being added with a vocab "
|
"instance that will not match other components. This is "
|
||||||
"instance that will not match other components. This is "
|
"usually an error.")
|
||||||
"usually an error."
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
class Errors(metaclass=ErrorsWithCodes):
|
class Errors(metaclass=ErrorsWithCodes):
|
||||||
|
|
|
@ -2427,7 +2427,7 @@ def _get_instantiated_vocab(
|
||||||
elif isinstance(vocab, Vocab):
|
elif isinstance(vocab, Vocab):
|
||||||
for name, inst_voc in vocab_instances.items():
|
for name, inst_voc in vocab_instances.items():
|
||||||
if inst_voc is not vocab:
|
if inst_voc is not vocab:
|
||||||
warnings.warn(Warnings.W125.format(name=name))
|
warnings.warn(Warnings.W126.format(name=name))
|
||||||
return vocab
|
return vocab
|
||||||
else:
|
else:
|
||||||
resolved_vocab = None
|
resolved_vocab = None
|
||||||
|
@ -2435,7 +2435,7 @@ def _get_instantiated_vocab(
|
||||||
if resolved_vocab is None:
|
if resolved_vocab is None:
|
||||||
resolved_vocab = inst_voc
|
resolved_vocab = inst_voc
|
||||||
elif inst_voc is not resolved_vocab:
|
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 --
|
# This is supposed to only be for the type checker --
|
||||||
# it should be unreachable
|
# it should be unreachable
|
||||||
assert resolved_vocab is not None
|
assert resolved_vocab is not None
|
||||||
|
|
Loading…
Reference in New Issue
Block a user