This commit is contained in:
Mike J Innes 2018-01-10 12:48:30 +00:00
parent daba42c595
commit 805cb9178f
3 changed files with 8 additions and 2 deletions

View File

@ -23,14 +23,14 @@ end
function symbols()
load()
Symbol.(split(readstring(deps("CMUDict", "cmudict.symbols")),
Symbol.(split(readstring(deps("cmudict", "cmudict.symbols")),
"\n", keep = false))
end
function rawdict()
load()
Dict(String(xs[1]) => Symbol.(xs[2:end]) for xs in
filter(!isempty, split.(split(readstring(deps("CMUDict", "cmudict")), "\n"))))
filter(!isempty, split.(split(readstring(deps("cmudict", "cmudict")), "\n"))))
end
validword(s) = ismatch(r"^[\w\-\.]+$", s)

View File

@ -1,3 +1,8 @@
using Flux.Data
using Base.Test
@test cmudict()["CATASTROPHE"] == :[K,AH0,T,AE1,S,T,R,AH0,F,IY0].args
@test length(CMUDict.phones()) == 39
@test length(CMUDict.symbols()) == 84

View File

@ -7,5 +7,6 @@ include("tracker.jl")
include("layers/normalisation.jl")
include("layers/stateless.jl")
include("optimise.jl")
include("data.jl")
end