add default_model to about

This commit is contained in:
Henning Peters 2016-01-15 18:07:15 +01:00
parent 788f734513
commit 780cb847c9
3 changed files with 4 additions and 4 deletions

View File

@ -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
"""

View File

@ -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)

View File

@ -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)