Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def count_words(string)
- words = string.gsub(/[^a-zA-Z\s]/,'').split(/\s+/)
- freqs = {}
- words.each { |key| freqs[key] += 1 }
- end
- count_words(ARGV[0])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement