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.139 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.138 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.137 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.136 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.135 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.134 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.133 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.132 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.131 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.130 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.129 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.128 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.127 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.126 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.125 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.124 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.123 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.122 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.121 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.120 tracks/julia/exercises/word-count/example.jl