mirror of
https://github.com/explosion/spaCy.git
synced 2025-08-06 13:20:20 +03:00
Fix registry find return type
This commit is contained in:
parent
9a454676f3
commit
fb89eb898e
|
@ -144,8 +144,17 @@ class registry(thinc.registry):
|
||||||
return func
|
return func
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def find(cls, registry_name: str, func_name: str) -> Callable:
|
def find(
|
||||||
"""Get info about a registered function from the registry."""
|
cls, registry_name: str, func_name: str
|
||||||
|
) -> Dict[str, Optional[Union[str, int]]]:
|
||||||
|
"""Find the information about a registered function, including the
|
||||||
|
module and path to the file it's defined in, the line number and the
|
||||||
|
docstring, if available.
|
||||||
|
|
||||||
|
registry_name (str): Name of the catalogue registry
|
||||||
|
func_name (str): Name of the registered function.
|
||||||
|
RETURNS (Dict[str, Optional[Union[str, int]]]): The function info.
|
||||||
|
"""
|
||||||
# We're overwriting this classmethod so we're able to provide more
|
# We're overwriting this classmethod so we're able to provide more
|
||||||
# specific error messages and implement a fallback to spacy-legacy.
|
# specific error messages and implement a fallback to spacy-legacy.
|
||||||
if not hasattr(cls, registry_name):
|
if not hasattr(cls, registry_name):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user