From eff94067180e85529acc7814a9cc7e6fdc224f08 Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Tue, 15 Sep 2020 11:39:36 +0200 Subject: [PATCH] Support vocab arg in spacy.blank --- spacy/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spacy/__init__.py b/spacy/__init__.py index d43dab781..7334b4149 100644 --- a/spacy/__init__.py +++ b/spacy/__init__.py @@ -18,6 +18,7 @@ from .util import registry, logger # noqa: F401 from .errors import Errors from .language import Language +from .vocab import Vocab from . import util @@ -49,12 +50,14 @@ def load( def blank( name: str, *, + vocab: Union[Vocab, bool] = True, config: Union[Dict[str, Any], Config] = util.SimpleFrozenDict(), meta: Dict[str, Any] = util.SimpleFrozenDict() ) -> Language: """Create a blank nlp object for a given language code. name (str): The language code, e.g. "en". + vocab (Vocab): A Vocab object. If True, a vocab is created. config (Dict[str, Any] / Config): Optional config overrides. meta (Dict[str, Any]): Overrides for nlp.meta. RETURNS (Language): The nlp object.