Sha256: d48e21abefaec771e8a21ba9d0aa67eefdb460ed4315784da2540911a9aa32d5

Contents?: true

Size: 252 Bytes

Versions: 311

Compression:

Stored size: 252 Bytes

Contents

function wordcount(sentence::AbstractString)
    sentence = lowercase(sentence)
    words = Dict()
    for rx = eachmatch(r"[a-z]+'[a-z]+|[0-9a-z]+", sentence)
        word = rx.match
        words[word] = get(words, word, 0) + 1
    end
    words
end

Version data entries

311 entries across 311 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.179 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.178 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.177 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.176 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.175 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.174 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.173 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.172 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.171 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.170 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.169 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.167 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.166 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.165 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.164 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.163 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.162 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.161 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.160 tracks/julia/exercises/word-count/example.jl