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.119 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.118 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.117 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.116 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.115 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.114 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.113 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.111 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.110 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.109 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.108 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.107 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.106 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.105 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.104 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.103 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.102 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.101 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.100 tracks/julia/exercises/word-count/example.jl
trackler-2.2.1.99 tracks/julia/exercises/word-count/example.jl