* Fix download script

This commit is contained in:
Matthew Honnibal 2015-01-30 19:28:43 +11:00
parent e578bd37bd
commit cb95ef6934
1 changed files with 3 additions and 3 deletions

View File

@ -20,13 +20,13 @@ def download_file(url, out):
def install_all_data(url, dest_dir):
filename = download_file(url, dest_dir)
t = tarfile.open(path.join(dest_dir, filename), mode=":gz")
t = tarfile.open(path.join(dest_dir, filename))
t.extractall(dest_dir)
def install_parser_model(url, dest_dir):
filename = download_file(url, dest_dir)
t = tarfile.open(path.join(dest_dir, filename), mode=":gz")
t.extractall(dest_dir)
t.extractall(path.dirname(__file__))
def install_dep_vectors(url, dest_dir):
@ -38,7 +38,7 @@ def install_dep_vectors(url, dest_dir):
def main():
if not path.exists(DEST_DIR):
install_all_data(DATA_DIR_URL, DEST_DIR)
install_all_data(DATA_DIR_URL, path.dirname(DEST_DIR))
else:
install_parser_model(PARSER_URL, DEST_DIR)
install_dep_vectors(DEP_VECTORS_URL, path.join(DEST_DIR, 'vocab'))