README.md (1391B) - raw
1 # Word Count 2 3 Welcome to Word Count on Exercism's Perl 5 Track. 4 If you need help running the tests or submitting your code, check out `HELP.md`. 5 6 ## Instructions 7 8 Given a phrase, count the occurrences of each _word_ in that phrase. 9 10 For the purposes of this exercise you can expect that a _word_ will always be one of: 11 12 1. A _number_ composed of one or more ASCII digits (ie "0" or "1234") OR 13 2. A _simple word_ composed of one or more ASCII letters (ie "a" or "they") OR 14 3. A _contraction_ of two _simple words_ joined by a single apostrophe (ie "it's" or "they're") 15 16 When counting words you can assume the following rules: 17 18 1. The count is _case insensitive_ (ie "You", "you", and "YOU" are 3 uses of the same word) 19 2. The count is _unordered_; the tests will ignore how words and counts are ordered 20 3. Other than the apostrophe in a _contraction_ all forms of _punctuation_ are ignored 21 4. The words can be separated by _any_ form of whitespace (ie "\t", "\n", " ") 22 23 For example, for the phrase `"That's the password: 'PASSWORD 123'!", cried the Special Agent.\nSo I fled.` the count would be: 24 25 ```text 26 that's: 1 27 the: 2 28 password: 2 29 123: 1 30 cried: 1 31 special: 1 32 agent: 1 33 so: 1 34 i: 1 35 fled: 1 36 ``` 37 38 ## Source 39 40 ### Created by 41 42 - @szabgab 43 44 ### Contributed to by 45 46 - @kytrinyx 47 - @m-dango 48 - @rfilipo 49 50 ### Based on 51 52 This is a classic toy problem, but we were reminded of it by seeing it in the Go Tour.