Better download detection
This commit is contained in:
parent
19f691d342
commit
6445295318
@ -5,13 +5,18 @@ export cmudict
|
|||||||
using ..Data: deps
|
using ..Data: deps
|
||||||
|
|
||||||
const version = "0.7b"
|
const version = "0.7b"
|
||||||
|
const cache_prefix = "https://cache.julialang.org"
|
||||||
|
|
||||||
function load()
|
function load()
|
||||||
isdir(deps("cmudict")) && return
|
suffixes = ["", ".phones", ".symbols"]
|
||||||
|
if isdir(deps("cmudict"))
|
||||||
|
if all(isfile.(["cmudict$x" for x in suffixes]))
|
||||||
|
return
|
||||||
|
end
|
||||||
|
end
|
||||||
mkpath(deps("cmudict"))
|
mkpath(deps("cmudict"))
|
||||||
for x in ["", ".phones", ".symbols"]
|
for x in suffixes
|
||||||
download("https://cache.julialang.org/http://svn.code.sf.net/p/cmusphinx/code/trunk/cmudict/cmudict-$version$x",
|
download("$cache_prefix/http://svn.code.sf.net/p/cmusphinx/code/trunk/cmudict/cmudict-$version$x", deps("cmudict", "cmudict$x"))
|
||||||
deps("cmudict", "cmudict$x"))
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user