From 0f943157af150a9ff2afc1497e5d3a3359585f67 Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Tue, 15 Sep 2020 11:07:55 +0200 Subject: [PATCH] Delegate to Language.from_config in spacy.blank --- spacy/__init__.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/spacy/__init__.py b/spacy/__init__.py index 5c286ed80..d640e2bbc 100644 --- a/spacy/__init__.py +++ b/spacy/__init__.py @@ -46,12 +46,14 @@ def load( 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. 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. """ LangClass = util.get_lang_class(name) - return LangClass(**overrides) + return LangClass.from_config(config)