From 780cb847c952ca2a836e90907c36836c53d3cf34 Mon Sep 17 00:00:00 2001 From: Henning Peters Date: Fri, 15 Jan 2016 18:07:15 +0100 Subject: [PATCH] add default_model to about --- setup.py | 1 + spacy/en/download.py | 5 ++--- spacy/language.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 349e85b6b..01035b078 100644 --- a/setup.py +++ b/setup.py @@ -158,6 +158,7 @@ version = '%(version)s' full_version = '%(full_version)s' git_revision = '%(git_revision)s' release = %(isrelease)s +default_model = 'en_default==1.0.4' if not release: version = full_version """ diff --git a/spacy/en/download.py b/spacy/en/download.py index 3195aa127..1b50feeb6 100644 --- a/spacy/en/download.py +++ b/spacy/en/download.py @@ -39,16 +39,15 @@ def link(package, path): force=("Force overwrite", "flag", "f", bool), ) def main(data_size='all', force=False): - package_name = 'en_default==1.0.4' path = os.path.dirname(os.path.abspath(__file__)) if force: sputnik.purge('spacy', about.short_version) - package = sputnik.install('spacy', about.short_version, package_name) + package = sputnik.install('spacy', about.short_version, about.default_model) try: - sputnik.package('spacy', about.short_version, package_name) + sputnik.package('spacy', about.short_version, about.default_model) except PackageNotFoundException, CompatiblePackageNotFoundException: print("Model failed to install. Please run 'python -m " "spacy.en.download --force'.", file=sys.stderr) diff --git a/spacy/language.py b/spacy/language.py index 8c86d53dd..ab6f95644 100644 --- a/spacy/language.py +++ b/spacy/language.py @@ -196,7 +196,7 @@ class Language(object): via = data_dir if via is None: - package = util.get_package_by_name('en_default==1.0.4') + package = util.get_package_by_name(about.default_model) else: package = util.get_package(via)