mirror of
https://github.com/explosion/spaCy.git
synced 2025-02-10 00:20:35 +03:00
Unbreak data download
This commit is contained in:
parent
8ae8b443f1
commit
0f9b8a00a5
|
@ -12,7 +12,7 @@ from . import util
|
||||||
|
|
||||||
def download(lang, force=False, fail_on_exist=True, data_path=None):
|
def download(lang, force=False, fail_on_exist=True, data_path=None):
|
||||||
if not data_path:
|
if not data_path:
|
||||||
data_path = util.get_data_path()
|
data_path = util.get_data_path(require_exists=False)
|
||||||
|
|
||||||
# spaCy uses pathlib, and util.get_data_path returns a pathlib.Path object,
|
# spaCy uses pathlib, and util.get_data_path returns a pathlib.Path object,
|
||||||
# but sputnik (which we're using below) doesn't use pathlib and requires
|
# but sputnik (which we're using below) doesn't use pathlib and requires
|
||||||
|
|
|
@ -32,7 +32,10 @@ def get_lang_class(name):
|
||||||
return LANGUAGES[lang]
|
return LANGUAGES[lang]
|
||||||
|
|
||||||
|
|
||||||
def get_data_path():
|
def get_data_path(require_exists=True):
|
||||||
|
if not require_exists:
|
||||||
|
return _data_path
|
||||||
|
else:
|
||||||
return _data_path if _data_path.exists() else None
|
return _data_path if _data_path.exists() else None
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user