mirror of
https://github.com/explosion/spaCy.git
synced 2024-12-25 09:26:27 +03:00
Delegate to Language.from_config in spacy.blank
This commit is contained in:
parent
e977086a9a
commit
0f943157af
|
@ -46,12 +46,14 @@ def load(
|
||||||
return util.load_model(name, disable=disable, exclude=exclude, config=config)
|
return util.load_model(name, disable=disable, exclude=exclude, config=config)
|
||||||
|
|
||||||
|
|
||||||
def blank(name: str, **overrides) -> Language:
|
def blank(
|
||||||
|
name: str, *, config: Union[Dict[str, Any], Config] = util.SimpleFrozenDict()
|
||||||
|
) -> Language:
|
||||||
"""Create a blank nlp object for a given language code.
|
"""Create a blank nlp object for a given language code.
|
||||||
|
|
||||||
name (str): The language code, e.g. "en".
|
name (str): The language code, e.g. "en".
|
||||||
**overrides: Keyword arguments passed to language subclass on init.
|
config (Dict[str, Any] / Config): Optional config overrides.
|
||||||
RETURNS (Language): The nlp object.
|
RETURNS (Language): The nlp object.
|
||||||
"""
|
"""
|
||||||
LangClass = util.get_lang_class(name)
|
LangClass = util.get_lang_class(name)
|
||||||
return LangClass(**overrides)
|
return LangClass.from_config(config)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user