Skip to content

Files

Latest commit

821bbeb · Aug 8, 2019

History

History

04-word-count

Word Count

Write a program that given a phrase can count the occurrences of each word in that phrase. The program has special handling rules for whitespace characters like new lines and tabs, as well as handling punctuation. Read the test matchers carefully to uncover the rules.

For example, calling word_count("everybody loves tacos right?") should return a hash that looks like this:

{
  "everybody" => 1,
  "loves" => 1,
  "tacos" => 1,
  "right?" => 1
}

Source

The golang tour