Sha256: bf717927a088f376d9c28ae0453296430a61798f414061925721d4246b6d5f42

Contents?: true

Size: 234 Bytes

Versions: 7

Compression:

Stored size: 234 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

7 entries across 7 versions & 1 rubygems

Version Path
trackler-2.0.6.29 tracks/julia/exercises/word-count/example.jl
trackler-2.0.6.28 tracks/julia/exercises/word-count/example.jl
trackler-2.0.6.27 tracks/julia/exercises/word-count/example.jl
trackler-2.0.6.26 tracks/julia/exercises/word-count/example.jl
trackler-2.0.6.25 tracks/julia/exercises/word-count/example.jl
trackler-2.0.6.24 tracks/julia/exercises/word-count/example.jl
trackler-2.0.6.23 tracks/julia/exercises/word-count/example.jl