|
1 |
| -{ |
2 |
| - "exercise": "word-count", |
3 |
| - "version": "1.0.0", |
4 |
| - |
5 |
| - "cases": [ |
6 |
| - { |
7 |
| - "description": "count one word", |
8 |
| - "property": "countwords", |
9 |
| - "input": "word", |
10 |
| - "expected": {"word": 1} |
11 |
| - }, |
12 |
| - { |
13 |
| - "description": "count one of each word", |
14 |
| - "property": "countwords", |
15 |
| - "input": "one of each", |
16 |
| - "expected": { "one": 1, "of": 1, "each": 1 } |
17 |
| - }, |
18 |
| - { |
19 |
| - "description": "multiple occurrences of a word", |
20 |
| - "property": "countwords", |
21 |
| - "input": "one fish two fish red fish blue fish", |
22 |
| - "expected": { "one": 1, "fish": 4, "two": 1, "red": 1, "blue": 1 } |
23 |
| - }, |
24 |
| - { |
25 |
| - "description": "handles cramped lists", |
26 |
| - "property": "countwords", |
27 |
| - "input": "one,two,three", |
28 |
| - "expected": { "one": 1, "two": 1, "three": 1 } |
29 |
| - }, |
30 |
| - { |
31 |
| - "description": "handles expanded lists", |
32 |
| - "property": "countwords", |
33 |
| - "input": "one,\ntwo,\nthree", |
34 |
| - "expected": { "one": 1, "two": 1, "three": 1 } |
35 |
| - }, |
36 |
| - { |
37 |
| - "description": "ignore punctuation", |
38 |
| - "property": "countwords", |
39 |
| - "input": "car: carpet as java: javascript!!&@$%^&", |
40 |
| - "expected": { "car": 1, "carpet": 1, "as": 1, "java": 1, "javascript": 1 } |
41 |
| - }, |
42 |
| - { |
43 |
| - "description": "include numbers", |
44 |
| - "property": "countwords", |
45 |
| - "input": "testing, 1, 2 testing", |
46 |
| - "expected": { "testing": 2, "1": 1, "2": 1 } |
47 |
| - }, |
48 |
| - { |
49 |
| - "description": "normalize case", |
50 |
| - "property": "countwords", |
51 |
| - "input": "go Go GO Stop stop", |
52 |
| - "expected": { "go": 3, "stop": 2 } |
53 |
| - }, |
54 |
| - { |
55 |
| - "description": "with apostrophes", |
56 |
| - "property": "countwords", |
57 |
| - "input": "First: don't laugh. Then: don't cry.", |
58 |
| - "expected": { "first": 1, "don't": 2, "laugh": 1, "then": 1, "cry": 1 } |
59 |
| - }, |
60 |
| - { |
61 |
| - "description": "with quotations", |
62 |
| - "property": "countwords", |
63 |
| - "input": "Joe can't tell between 'large' and large.", |
64 |
| - "expected": { "joe": 1, "can't": 1, "tell": 1, "between": 1, "large": 2, "and": 1 } |
65 |
| - } |
66 |
| - ] |
67 |
| -} |
| 1 | +{ |
| 2 | + "exercise": "word-count", |
| 3 | + "version": "1.0.0", |
| 4 | + "cases": [ |
| 5 | + { |
| 6 | + "description": "count one word", |
| 7 | + "property": "countwords", |
| 8 | + "input": "word", |
| 9 | + "expected": { |
| 10 | + "word": 1 |
| 11 | + } |
| 12 | + }, |
| 13 | + { |
| 14 | + "description": "count one of each word", |
| 15 | + "property": "countwords", |
| 16 | + "input": "one of each", |
| 17 | + "expected": { |
| 18 | + "one": 1, |
| 19 | + "of": 1, |
| 20 | + "each": 1 |
| 21 | + } |
| 22 | + }, |
| 23 | + { |
| 24 | + "description": "multiple occurrences of a word", |
| 25 | + "property": "countwords", |
| 26 | + "input": "one fish two fish red fish blue fish", |
| 27 | + "expected": { |
| 28 | + "one": 1, |
| 29 | + "fish": 4, |
| 30 | + "two": 1, |
| 31 | + "red": 1, |
| 32 | + "blue": 1 |
| 33 | + } |
| 34 | + }, |
| 35 | + { |
| 36 | + "description": "handles cramped lists", |
| 37 | + "property": "countwords", |
| 38 | + "input": "one,two,three", |
| 39 | + "expected": { |
| 40 | + "one": 1, |
| 41 | + "two": 1, |
| 42 | + "three": 1 |
| 43 | + } |
| 44 | + }, |
| 45 | + { |
| 46 | + "description": "handles expanded lists", |
| 47 | + "property": "countwords", |
| 48 | + "input": "one,\ntwo,\nthree", |
| 49 | + "expected": { |
| 50 | + "one": 1, |
| 51 | + "two": 1, |
| 52 | + "three": 1 |
| 53 | + } |
| 54 | + }, |
| 55 | + { |
| 56 | + "description": "ignore punctuation", |
| 57 | + "property": "countwords", |
| 58 | + "input": "car: carpet as java: javascript!!&@$%^&", |
| 59 | + "expected": { |
| 60 | + "car": 1, |
| 61 | + "carpet": 1, |
| 62 | + "as": 1, |
| 63 | + "java": 1, |
| 64 | + "javascript": 1 |
| 65 | + } |
| 66 | + }, |
| 67 | + { |
| 68 | + "description": "include numbers", |
| 69 | + "property": "countwords", |
| 70 | + "input": "testing, 1, 2 testing", |
| 71 | + "expected": { |
| 72 | + "testing": 2, |
| 73 | + "1": 1, |
| 74 | + "2": 1 |
| 75 | + } |
| 76 | + }, |
| 77 | + { |
| 78 | + "description": "normalize case", |
| 79 | + "property": "countwords", |
| 80 | + "input": "go Go GO Stop stop", |
| 81 | + "expected": { |
| 82 | + "go": 3, |
| 83 | + "stop": 2 |
| 84 | + } |
| 85 | + }, |
| 86 | + { |
| 87 | + "description": "with apostrophes", |
| 88 | + "property": "countwords", |
| 89 | + "input": "First: don't laugh. Then: don't cry.", |
| 90 | + "expected": { |
| 91 | + "first": 1, |
| 92 | + "don't": 2, |
| 93 | + "laugh": 1, |
| 94 | + "then": 1, |
| 95 | + "cry": 1 |
| 96 | + } |
| 97 | + }, |
| 98 | + { |
| 99 | + "description": "with quotations", |
| 100 | + "property": "countwords", |
| 101 | + "input": "Joe can't tell between 'large' and large.", |
| 102 | + "expected": { |
| 103 | + "joe": 1, |
| 104 | + "can't": 1, |
| 105 | + "tell": 1, |
| 106 | + "between": 1, |
| 107 | + "large": 2, |
| 108 | + "and": 1 |
| 109 | + } |
| 110 | + } |
| 111 | + ] |
| 112 | +} |
0 commit comments