mirror of https://github.com/explosion/spaCy.git
cleanup api
This commit is contained in:
parent
aa4d964c14
commit
eb7ae61b1c
|
@ -5,4 +5,4 @@ from .en import English
|
||||||
def load(name, vectors=None, via=None):
|
def load(name, vectors=None, via=None):
|
||||||
return English(
|
return English(
|
||||||
package=util.get_package_by_name(name, via=via),
|
package=util.get_package_by_name(name, via=via),
|
||||||
vectors_package=util.get_package_by_name(vectors_name, via=via))
|
vectors_package=util.get_package_by_name(vectors, via=via))
|
||||||
|
|
|
@ -25,9 +25,9 @@ def get_package_by_name(name=None, via=None):
|
||||||
return sputnik.package(about.__title__, about.__version__,
|
return sputnik.package(about.__title__, about.__version__,
|
||||||
name or about.__default_model__, data_path=via)
|
name or about.__default_model__, data_path=via)
|
||||||
except PackageNotFoundException as e:
|
except PackageNotFoundException as e:
|
||||||
raise RuntimeError("Model not installed. Please run 'python -m "
|
raise RuntimeError("Model %s not installed. Please run 'python -m "
|
||||||
"spacy.en.download' to install latest compatible "
|
"spacy.en.download' to install latest compatible "
|
||||||
"model.")
|
"model." % name)
|
||||||
except CompatiblePackageNotFoundException as e:
|
except CompatiblePackageNotFoundException as e:
|
||||||
raise RuntimeError("Installed model is not compatible with spaCy "
|
raise RuntimeError("Installed model is not compatible with spaCy "
|
||||||
"version. Please run 'python -m spacy.en.download "
|
"version. Please run 'python -m spacy.en.download "
|
||||||
|
|
Loading…
Reference in New Issue