From 683a73fed3f655b3d24a6c1e888faa39df8e42d2 Mon Sep 17 00:00:00 2001 From: Mike J Innes Date: Sun, 15 Apr 2018 20:09:08 +0100 Subject: [PATCH] download info --- src/data/cmudict.jl | 6 ++++-- src/data/mnist.jl | 1 + src/data/sentiment.jl | 8 ++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/data/cmudict.jl b/src/data/cmudict.jl index 3ac47ef1..2a26b691 100644 --- a/src/data/cmudict.jl +++ b/src/data/cmudict.jl @@ -10,13 +10,15 @@ const cache_prefix = "https://cache.julialang.org" function load() suffixes = ["", ".phones", ".symbols"] if isdir(deps("cmudict")) - if all(isfile.(["cmudict$x" for x in suffixes])) + if all(isfile(deps("cmudict", "cmudict$x")) for x in suffixes) return end end + info("Downloading CMUDict dataset") mkpath(deps("cmudict")) for x in suffixes - download("$cache_prefix/http://svn.code.sf.net/p/cmusphinx/code/trunk/cmudict/cmudict-$version$x", deps("cmudict", "cmudict$x")) + download("$cache_prefix/http://svn.code.sf.net/p/cmusphinx/code/trunk/cmudict/cmudict-$version$x", + deps("cmudict", "cmudict$x")) end end diff --git a/src/data/mnist.jl b/src/data/mnist.jl index 132bf219..34bcd50c 100644 --- a/src/data/mnist.jl +++ b/src/data/mnist.jl @@ -14,6 +14,7 @@ function load() "t10k-images-idx3-ubyte", "t10k-labels-idx1-ubyte"] isfile(file) && continue + info("Downloading MNIST dataset") download("https://cache.julialang.org/http://yann.lecun.com/exdb/mnist/$file.gz", "$file.gz") open(file, "w") do io write(io, GZip.open(read, "$file.gz")) diff --git a/src/data/sentiment.jl b/src/data/sentiment.jl index ae9f9261..570fcf5d 100644 --- a/src/data/sentiment.jl +++ b/src/data/sentiment.jl @@ -4,10 +4,10 @@ using ZipFile using ..Data: deps function load() - isfile(deps("sentiment.zip")) || - download("https://cache.julialang.org/https://nlp.stanford.edu/sentiment/trainDevTestTrees_PTB.zip", - deps("sentiment.zip")) - return + isfile(deps("sentiment.zip")) || return + info("Downloading sentiment treebank dataset") + download("https://cache.julialang.org/https://nlp.stanford.edu/sentiment/trainDevTestTrees_PTB.zip", + deps("sentiment.zip")) end getfile(r, name) = r.files[findfirst(x -> x.name == name, r.files)]