mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-24 17:06:29 +03:00
Fix small errors
This commit is contained in:
parent
46568f40a7
commit
70ee4ef4fd
|
@ -42,7 +42,7 @@ def _normalize_props(props):
|
||||||
elif isinstance(key, (int, str)) and isinstance(value, (int, str)):
|
elif isinstance(key, (int, str)) and isinstance(value, (int, str)):
|
||||||
out[key] = value
|
out[key] = value
|
||||||
else:
|
else:
|
||||||
warnings.warn(Warnings.W028.format(feature={key: value}))
|
warnings.warn(Warnings.W029.format(feature={key: value}))
|
||||||
return out
|
return out
|
||||||
|
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ cdef class Morphology:
|
||||||
return tag_ptr.key
|
return tag_ptr.key
|
||||||
features = self.feats_to_dict(features)
|
features = self.feats_to_dict(features)
|
||||||
if not isinstance(features, dict):
|
if not isinstance(features, dict):
|
||||||
warnings.warn(Warnings.W028.format(feature=features))
|
warnings.warn(Warnings.W029.format(feature=features))
|
||||||
features = {}
|
features = {}
|
||||||
features = _normalize_props(features)
|
features = _normalize_props(features)
|
||||||
string_features = {self.strings.as_string(field): self.strings.as_string(values) for field, values in features.items()}
|
string_features = {self.strings.as_string(field): self.strings.as_string(values) for field, values in features.items()}
|
||||||
|
|
|
@ -781,7 +781,7 @@ cdef class Doc:
|
||||||
attrs = [(IDS[id_.upper()] if hasattr(id_, "upper") else id_)
|
attrs = [(IDS[id_.upper()] if hasattr(id_, "upper") else id_)
|
||||||
for id_ in attrs]
|
for id_ in attrs]
|
||||||
if array.dtype != numpy.uint64:
|
if array.dtype != numpy.uint64:
|
||||||
user_warning(Warnings.W028.format(type=array.dtype))
|
warnings.warn(Warnings.W028.format(type=array.dtype))
|
||||||
|
|
||||||
if SENT_START in attrs and HEAD in attrs:
|
if SENT_START in attrs and HEAD in attrs:
|
||||||
raise ValueError(Errors.E032)
|
raise ValueError(Errors.E032)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user