trackler 2.1.0.20 → 2.1.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/trackler/version.rb +1 -1
- data/tracks/haskell/exercises/parallel-letter-frequency/HINTS.md +4 -0
- data/tracks/haskell/exercises/parallel-letter-frequency/bench/Benchmark.hs +40 -0
- data/tracks/haskell/exercises/parallel-letter-frequency/examples/success-standard/package.yaml +10 -0
- data/tracks/haskell/exercises/parallel-letter-frequency/package.yaml +11 -1
- data/tracks/java/exercises/binary-search/src/test/java/BinarySearchTest.java +70 -78
- data/tracks/java/exercises/change/src/test/java/ChangeCalculatorTest.java +1 -1
- data/tracks/vimscript/config.json +14 -6
- data/tracks/vimscript/exercises/atbash-cipher/atbash_cipher.vader +50 -0
- data/tracks/vimscript/exercises/atbash-cipher/atbash_cipher.vim +23 -0
- data/tracks/vimscript/exercises/atbash-cipher/example.vim +21 -0
- data/tracks/vimscript/exercises/word-count/example.vim +10 -0
- data/tracks/vimscript/exercises/word-count/word_count.vader +54 -0
- data/tracks/vimscript/exercises/word-count/word_count.vim +14 -0
- metadata +9 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10fae0e15e9198dab905f9201679574b543a3803
|
4
|
+
data.tar.gz: a463c33562dc740ccfa9a73402a211d2a19ecc6a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ece06dd2344a889439d5fdad91e9a8b8838ac4a1c734a2b98971eac2af3ab5ee6aeca6048ea537894a051ed82a426af86e90555baf40d9db7bae7f6ae134aa9
|
7
|
+
data.tar.gz: a39f6786f6d649c82f57c58e8094bd3768dcea709d3e05ad248ca12a3188acc1f646b06b2303872a768712b55540775ffe243addf18b1eeb62ba6b40e996518f
|
data/lib/trackler/version.rb
CHANGED
@@ -3,3 +3,7 @@
|
|
3
3
|
Your code should contain a frequency :: Int -> [Text] -> Map Char Int
|
4
4
|
function which accepts a number of workers to use in parallel and a list
|
5
5
|
of texts and returns the total frequency of each letter in the text.
|
6
|
+
|
7
|
+
### Benchmark
|
8
|
+
|
9
|
+
Check how changing number of workers affects performance of your solution by running the benchmark. Use `stack bench` to run it. Feel free to modify `bench/Benchmark.hs` to explore your solution's performance on different inputs.
|
@@ -0,0 +1,40 @@
|
|
1
|
+
{-# LANGUAGE OverloadedStrings #-}
|
2
|
+
|
3
|
+
import Frequency (frequency)
|
4
|
+
|
5
|
+
import Prelude hiding (unlines)
|
6
|
+
import Data.Text (Text, unlines)
|
7
|
+
|
8
|
+
import Criterion.Main (bench, bgroup, defaultMain, nf)
|
9
|
+
import Criterion.Types (Benchmark)
|
10
|
+
import Control.Concurrent (getNumCapabilities)
|
11
|
+
import Data.List (nub, sort, replicate)
|
12
|
+
|
13
|
+
odeAnDieFreude :: Text
|
14
|
+
odeAnDieFreude = unlines
|
15
|
+
[ "Freude schöner Götterfunken"
|
16
|
+
, "Tochter aus Elysium,"
|
17
|
+
, "Wir betreten feuertrunken,"
|
18
|
+
, "Himmlische, dein Heiligtum!"
|
19
|
+
, "Deine Zauber binden wieder"
|
20
|
+
, "Was die Mode streng geteilt;"
|
21
|
+
, "Alle Menschen werden Brüder,"
|
22
|
+
, "Wo dein sanfter Flügel weilt."
|
23
|
+
]
|
24
|
+
|
25
|
+
|
26
|
+
makeBench :: [Text] -> Int -> Benchmark
|
27
|
+
makeBench anthems workers = bench name $ nf (`frequency` anthems) workers
|
28
|
+
where name = show workers ++ " workers"
|
29
|
+
|
30
|
+
benchGroup :: Int -> [Int] -> Int -> Benchmark
|
31
|
+
benchGroup processors numWorkers numAnthems =
|
32
|
+
bgroup (show numAnthems ++ " anthems on " ++ show processors ++ " threads") (makeBench anthems <$> numWorkers)
|
33
|
+
where anthems = replicate numAnthems odeAnDieFreude
|
34
|
+
|
35
|
+
main :: IO ()
|
36
|
+
main = do threads <- getNumCapabilities
|
37
|
+
let numsOfWorkers = nub $ sort [1..threads]
|
38
|
+
numsOfAnthems = [500]
|
39
|
+
|
40
|
+
defaultMain $ benchGroup threads numsOfWorkers <$> numsOfAnthems
|
@@ -1,5 +1,5 @@
|
|
1
1
|
name: parallel-letter-frequency
|
2
|
-
version: 0.1.0.
|
2
|
+
version: 0.1.0.3
|
3
3
|
|
4
4
|
dependencies:
|
5
5
|
- base
|
@@ -20,3 +20,13 @@ tests:
|
|
20
20
|
dependencies:
|
21
21
|
- parallel-letter-frequency
|
22
22
|
- hspec
|
23
|
+
|
24
|
+
benchmarks:
|
25
|
+
bench:
|
26
|
+
ghc-options: -threaded -with-rtsopts=-N -O2
|
27
|
+
|
28
|
+
main: Benchmark.hs
|
29
|
+
source-dirs: bench
|
30
|
+
dependencies:
|
31
|
+
- parallel-letter-frequency
|
32
|
+
- criterion
|
@@ -1,136 +1,128 @@
|
|
1
1
|
|
2
|
+
import org.junit.Ignore;
|
3
|
+
import org.junit.Test;
|
4
|
+
|
2
5
|
import java.util.ArrayList;
|
3
6
|
import java.util.Arrays;
|
4
7
|
import java.util.Collections;
|
5
8
|
import java.util.List;
|
9
|
+
|
6
10
|
import static org.junit.Assert.assertEquals;
|
7
|
-
import org.junit.Ignore;
|
8
|
-
import org.junit.Test;
|
9
11
|
|
10
12
|
public class BinarySearchTest {
|
11
13
|
|
12
|
-
public static final List<Integer> EMPTY_LIST
|
13
|
-
= Collections.unmodifiableList(new ArrayList<Integer>(0));
|
14
|
-
|
15
|
-
public static final List<Integer> LIST_OF_UNIT_LENGTH
|
16
|
-
= Collections.unmodifiableList(
|
17
|
-
Arrays.asList(6)
|
18
|
-
);
|
19
|
-
|
20
|
-
private static final List<Integer> SORTED_LIST
|
21
|
-
= Collections.unmodifiableList(
|
22
|
-
Arrays.asList(1, 3, 4, 6, 8, 9, 11)
|
23
|
-
);
|
24
|
-
|
25
|
-
public static final List<Integer> SORTED_LIST_OF_ODD_LENGTH
|
26
|
-
= Collections.unmodifiableList(
|
27
|
-
Arrays.asList(1, 3, 5, 8, 13, 21, 34, 55,
|
28
|
-
89, 144, 233, 377, 634)
|
29
|
-
);
|
30
|
-
|
31
|
-
public static final List<Integer> SORTED_LIST_OF_EVEN_LENGTH
|
32
|
-
= Collections.unmodifiableList(
|
33
|
-
Arrays.asList(1, 3, 5, 8, 13, 21, 34, 55,
|
34
|
-
89, 144, 233, 377)
|
35
|
-
);
|
36
|
-
|
37
14
|
@Test
|
38
15
|
public void findsAValueInAnArrayWithOneElement() {
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
assertEquals(
|
16
|
+
List<Integer> listOfUnitLength = Collections.singletonList(6);
|
17
|
+
|
18
|
+
BinarySearch<Integer> sut = new BinarySearch<>(listOfUnitLength);
|
19
|
+
|
20
|
+
assertEquals(0, sut.indexOf(6));
|
44
21
|
}
|
45
22
|
|
46
23
|
@Ignore("Remove to run test")
|
47
24
|
@Test
|
48
25
|
public void findsAValueInTheMiddleOfAnArray() {
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
26
|
+
List<Integer> sortedList = Collections.unmodifiableList(
|
27
|
+
Arrays.asList(1, 3, 4, 6, 8, 9, 11)
|
28
|
+
);
|
29
|
+
|
30
|
+
BinarySearch<Integer> sut = new BinarySearch<>(sortedList);
|
31
|
+
|
32
|
+
assertEquals(3, sut.indexOf(6));
|
54
33
|
}
|
55
34
|
|
56
35
|
@Ignore("Remove to run test")
|
57
36
|
@Test
|
58
37
|
public void findsAValueAtTheBeginningOfAnArray() {
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
38
|
+
List<Integer> sortedList = Collections.unmodifiableList(
|
39
|
+
Arrays.asList(1, 3, 4, 6, 8, 9, 11)
|
40
|
+
);
|
41
|
+
|
42
|
+
BinarySearch<Integer> sut = new BinarySearch<>(sortedList);
|
43
|
+
|
44
|
+
assertEquals(0, sut.indexOf(1));
|
64
45
|
}
|
65
46
|
|
66
47
|
@Ignore("Remove to run test")
|
67
48
|
@Test
|
68
49
|
public void findsAValueAtTheEndOfAnArray() {
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
50
|
+
List<Integer> sortedList = Collections.unmodifiableList(
|
51
|
+
Arrays.asList(1, 3, 4, 6, 8, 9, 11)
|
52
|
+
);
|
53
|
+
|
54
|
+
BinarySearch<Integer> sut = new BinarySearch<>(sortedList);
|
55
|
+
|
56
|
+
assertEquals(6, sut.indexOf(11));
|
74
57
|
}
|
75
58
|
|
76
59
|
@Ignore("Remove to run test")
|
77
60
|
@Test
|
78
61
|
public void findsAValueInAnArrayOfOddLength() {
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
62
|
+
List<Integer> sortedListOfOddLength = Collections.unmodifiableList(
|
63
|
+
Arrays.asList(1, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 634)
|
64
|
+
);
|
65
|
+
|
66
|
+
BinarySearch<Integer> sut = new BinarySearch<>(sortedListOfOddLength);
|
67
|
+
|
68
|
+
assertEquals(9, sut.indexOf(144));
|
84
69
|
}
|
85
70
|
|
86
71
|
@Ignore("Remove to run test")
|
87
72
|
@Test
|
88
73
|
public void findsAValueInAnArrayOfEvenLength() {
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
74
|
+
List<Integer> sortedListOfEvenLength = Collections.unmodifiableList(
|
75
|
+
Arrays.asList(1, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377)
|
76
|
+
);
|
77
|
+
|
78
|
+
BinarySearch<Integer> sut = new BinarySearch<>(sortedListOfEvenLength);
|
79
|
+
|
80
|
+
assertEquals(5, sut.indexOf(21));
|
95
81
|
}
|
96
82
|
|
97
83
|
@Ignore("Remove to run test")
|
98
84
|
@Test
|
99
85
|
public void identifiesThatAValueIsNotIncludedInTheArray() {
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
86
|
+
List<Integer> sortedList = Collections.unmodifiableList(
|
87
|
+
Arrays.asList(1, 3, 4, 6, 8, 9, 11)
|
88
|
+
);
|
89
|
+
|
90
|
+
BinarySearch<Integer> sut = new BinarySearch<>(sortedList);
|
91
|
+
|
92
|
+
assertEquals(-1, sut.indexOf(7));
|
105
93
|
}
|
106
94
|
|
107
95
|
@Ignore("Remove to run test")
|
108
96
|
@Test
|
109
97
|
public void aValueSmallerThanTheArraysSmallestValueIsNotIncluded() {
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
98
|
+
List<Integer> sortedList = Collections.unmodifiableList(
|
99
|
+
Arrays.asList(1, 3, 4, 6, 8, 9, 11)
|
100
|
+
);
|
101
|
+
|
102
|
+
BinarySearch<Integer> sut = new BinarySearch<>(sortedList);
|
103
|
+
|
104
|
+
assertEquals(-1, sut.indexOf(0));
|
115
105
|
}
|
116
106
|
|
117
107
|
@Ignore("Remove to run test")
|
118
108
|
@Test
|
119
109
|
public void aValueLargerThanTheArraysSmallestValueIsNotIncluded() {
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
110
|
+
List<Integer> sortedList = Collections.unmodifiableList(
|
111
|
+
Arrays.asList(1, 3, 4, 6, 8, 9, 11)
|
112
|
+
);
|
113
|
+
|
114
|
+
BinarySearch<Integer> sut = new BinarySearch<>(sortedList);
|
115
|
+
|
116
|
+
assertEquals(-1, sut.indexOf(13));
|
125
117
|
}
|
126
118
|
|
127
119
|
@Ignore("Remove to run test")
|
128
120
|
@Test
|
129
121
|
public void nothingIsIncludedInAnEmptyArray() {
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
assertEquals(
|
122
|
+
List<Integer> emptyList = Collections.emptyList();
|
123
|
+
|
124
|
+
BinarySearch<Integer> sut = new BinarySearch<>(emptyList);
|
125
|
+
|
126
|
+
assertEquals(-1, sut.indexOf(1));
|
135
127
|
}
|
136
128
|
}
|
@@ -8,7 +8,7 @@ import static java.util.Collections.emptyList;
|
|
8
8
|
import static java.util.Collections.singletonList;
|
9
9
|
import static org.junit.Assert.assertEquals;
|
10
10
|
|
11
|
-
public
|
11
|
+
public class ChangeCalculatorTest {
|
12
12
|
|
13
13
|
/*
|
14
14
|
* See https://github.com/junit-team/junit4/wiki/Rules for information on JUnit Rules in general and
|
@@ -3,6 +3,7 @@
|
|
3
3
|
"language": "Vim script",
|
4
4
|
"repository": "https://github.com/exercism/xvimscript",
|
5
5
|
"active": false,
|
6
|
+
"test_pattern": "\\.vader$",
|
6
7
|
"exercises": [
|
7
8
|
{
|
8
9
|
"slug": "hello-world",
|
@@ -32,20 +33,27 @@
|
|
32
33
|
{
|
33
34
|
"slug": "anagram",
|
34
35
|
"difficulty": 1,
|
35
|
-
"topics": [
|
36
|
-
]
|
36
|
+
"topics": []
|
37
37
|
},
|
38
38
|
{
|
39
39
|
"slug": "difference-of-squares",
|
40
40
|
"difficulty": 1,
|
41
|
-
"topics": [
|
42
|
-
]
|
41
|
+
"topics": []
|
43
42
|
},
|
44
43
|
{
|
45
44
|
"slug": "raindrops",
|
46
45
|
"difficulty": 1,
|
47
|
-
"topics": [
|
48
|
-
|
46
|
+
"topics": []
|
47
|
+
},
|
48
|
+
{
|
49
|
+
"slug": "word-count",
|
50
|
+
"difficulty": 1,
|
51
|
+
"topics": []
|
52
|
+
},
|
53
|
+
{
|
54
|
+
"slug": "atbash-cipher",
|
55
|
+
"difficulty": 1,
|
56
|
+
"topics": []
|
49
57
|
}
|
50
58
|
],
|
51
59
|
"deprecated": [],
|
@@ -0,0 +1,50 @@
|
|
1
|
+
" The tests are divided into two groups:
|
2
|
+
"
|
3
|
+
" - encoding from English to atbash cipher
|
4
|
+
" - decoding from atbash cipher to all-lowercase-mashed-together English
|
5
|
+
|
6
|
+
" Test encoding from English to atbash
|
7
|
+
|
8
|
+
Execute (encode yes):
|
9
|
+
AssertEqual 'bvh', AtbashEncode('yes')
|
10
|
+
|
11
|
+
Execute (encode no):
|
12
|
+
AssertEqual 'ml', AtbashEncode('no')
|
13
|
+
|
14
|
+
Execute (encode OMG):
|
15
|
+
AssertEqual 'lnt', AtbashEncode('OMG')
|
16
|
+
|
17
|
+
Execute (encode spaces):
|
18
|
+
AssertEqual 'lnt', AtbashEncode('O M G')
|
19
|
+
|
20
|
+
Execute (encode mindblowingly):
|
21
|
+
AssertEqual 'nrmwy oldrm tob', AtbashEncode('mindblowingly')
|
22
|
+
|
23
|
+
Execute (encode numbers):
|
24
|
+
AssertEqual 'gvhgr mt123 gvhgr mt', AtbashEncode('Testing,1 2 3, testing.')
|
25
|
+
|
26
|
+
Execute (encode deep thought):
|
27
|
+
AssertEqual 'gifgs rhurx grlm', AtbashEncode('Truth is fiction.')
|
28
|
+
|
29
|
+
Execute (encode all the letters):
|
30
|
+
AssertEqual
|
31
|
+
\ 'gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt',
|
32
|
+
\ AtbashEncode('The quick brown fox jumps over the lazy dog.')
|
33
|
+
|
34
|
+
" Test decoding from atbash to English
|
35
|
+
|
36
|
+
Execute (decode exercism):
|
37
|
+
AssertEqual 'exercism', AtbashDecode('vcvix rhn')
|
38
|
+
|
39
|
+
Execute (decode a sentence):
|
40
|
+
AssertEqual
|
41
|
+
\ 'anobstacleisoftenasteppingstone',
|
42
|
+
\ AtbashDecode('zmlyh gzxov rhlug vmzhg vkkrm thglm v')
|
43
|
+
|
44
|
+
Execute (decode numbers):
|
45
|
+
AssertEqual 'testing123testing', AtbashDecode('gvhgr mt123 gvhgr mt')
|
46
|
+
|
47
|
+
Execute (decode all the letters):
|
48
|
+
AssertEqual
|
49
|
+
\ 'thequickbrownfoxjumpsoverthelazydog',
|
50
|
+
\ AtbashDecode('gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt')
|
@@ -0,0 +1,23 @@
|
|
1
|
+
"
|
2
|
+
" Create an implementation of the atbash cipher, an ancient encryption system
|
3
|
+
" created in the Middle East.
|
4
|
+
"
|
5
|
+
" Examples:
|
6
|
+
"
|
7
|
+
" :echo AtbashEncode('test')
|
8
|
+
" gvhg
|
9
|
+
"
|
10
|
+
" :echo AtbashDecode('gvhg')
|
11
|
+
" test
|
12
|
+
"
|
13
|
+
" :echo AtbashDecode('gsvjf rxpyi ldmul cqfnk hlevi gsvoz abwlt')
|
14
|
+
" thequickbrownfoxjumpsoverthelazydog
|
15
|
+
"
|
16
|
+
|
17
|
+
function! AtbashDecode(cipher) abort
|
18
|
+
" your code goes here
|
19
|
+
endfunction
|
20
|
+
|
21
|
+
function! AtbashEncode(plaintext) abort
|
22
|
+
" your code goes here
|
23
|
+
endfunction
|
@@ -0,0 +1,21 @@
|
|
1
|
+
function! AtbashDecode(cipher) abort
|
2
|
+
return s:algorithm(s:normalize(a:cipher))
|
3
|
+
endfunction
|
4
|
+
|
5
|
+
function! AtbashEncode(plaintext) abort
|
6
|
+
return s:chunk(AtbashDecode(a:plaintext))
|
7
|
+
endfunction
|
8
|
+
|
9
|
+
function! s:normalize(text) abort
|
10
|
+
return substitute(tolower(a:text), '[^a-z0-9]', '', 'g')
|
11
|
+
endfunction
|
12
|
+
|
13
|
+
function! s:algorithm(text) abort
|
14
|
+
let alphabet = 'abcdefghijklmnopqrstuvwxyz'
|
15
|
+
let reversed = 'zyxwvutsrqponmlkjihgfedcba'
|
16
|
+
return tr(a:text, alphabet, reversed)
|
17
|
+
endfunction
|
18
|
+
|
19
|
+
function! s:chunk(text) abort
|
20
|
+
return join(split(a:text, '.\{5}\zs'))
|
21
|
+
endfunction
|
@@ -0,0 +1,54 @@
|
|
1
|
+
Before:
|
2
|
+
if exists('expected')
|
3
|
+
unlet expected
|
4
|
+
endif
|
5
|
+
|
6
|
+
Execute (count one word):
|
7
|
+
let phrase = 'word'
|
8
|
+
let expected = {'word': 1}
|
9
|
+
AssertEqual expected, WordCount(phrase)
|
10
|
+
|
11
|
+
Execute (count one of each word):
|
12
|
+
let phrase = 'one of each'
|
13
|
+
let expected = {'one': 1, 'of': 1, 'each': 1}
|
14
|
+
AssertEqual expected, WordCount(phrase)
|
15
|
+
|
16
|
+
Execute (multiple occurrences of a word):
|
17
|
+
let phrase = 'one fish two fish red fish blue fish'
|
18
|
+
let expected = {'one': 1, 'fish': 4, 'two': 1, 'red': 1, 'blue': 1}
|
19
|
+
AssertEqual expected, WordCount(phrase)
|
20
|
+
|
21
|
+
Execute (handles cramped lists):
|
22
|
+
let phrase = 'one,two,three'
|
23
|
+
let expected = {'one': 1, 'two': 1, 'three': 1}
|
24
|
+
AssertEqual expected, WordCount(phrase)
|
25
|
+
|
26
|
+
Execute (handles expanded lists):
|
27
|
+
let phrase = "one,\ntwo,\nthree"
|
28
|
+
let expected = {'one': 1, 'two': 1, 'three': 1}
|
29
|
+
AssertEqual expected, WordCount(phrase)
|
30
|
+
|
31
|
+
Execute (ignore punctuation):
|
32
|
+
let phrase = 'car: carpet as java: javascript!!&@$%^&'
|
33
|
+
let expected = {'car': 1, 'carpet': 1, 'as': 1, 'java': 1, 'javascript': 1}
|
34
|
+
AssertEqual expected, WordCount(phrase)
|
35
|
+
|
36
|
+
Execute (include numbers):
|
37
|
+
let phrase = 'testing, 1, 2 testing'
|
38
|
+
let expected = {'testing': 2, '1': 1, '2': 1}
|
39
|
+
AssertEqual expected, WordCount(phrase)
|
40
|
+
|
41
|
+
Execute (normalize case):
|
42
|
+
let phrase = 'go Go GO Stop stop'
|
43
|
+
let expected = {'go': 3, 'stop': 2}
|
44
|
+
AssertEqual expected, WordCount(phrase)
|
45
|
+
|
46
|
+
Execute (with apostrophes):
|
47
|
+
let phrase = "First: don't laugh. Then: don't cry."
|
48
|
+
let expected = {'first': 1, 'don''t': 2, 'laugh': 1, 'then': 1, 'cry': 1}
|
49
|
+
AssertEqual expected, WordCount(phrase)
|
50
|
+
|
51
|
+
Execute (with quotations):
|
52
|
+
let phrase = "Joe can't tell between 'large' and large."
|
53
|
+
let expected = {'joe': 1, 'can''t': 1, 'tell': 1, 'between': 1, 'large': 2, 'and': 1}
|
54
|
+
AssertEqual expected, WordCount(phrase)
|
@@ -0,0 +1,14 @@
|
|
1
|
+
"
|
2
|
+
" Given a phrase, return a dictionary containing the count of occurrences of
|
3
|
+
" each word.
|
4
|
+
"
|
5
|
+
" Example:
|
6
|
+
"
|
7
|
+
" :echo WordCount('olly olly in come free')
|
8
|
+
" {'olly': 2, 'come': 1, 'in': 1, 'free': 1}
|
9
|
+
"
|
10
|
+
function! WordCount(phrase) abort
|
11
|
+
|
12
|
+
" your solution goes here
|
13
|
+
|
14
|
+
endfunction
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trackler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.0.
|
4
|
+
version: 2.1.0.21
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Katrina Owen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyzip
|
@@ -3991,6 +3991,7 @@ files:
|
|
3991
3991
|
- tracks/haskell/exercises/pangram/stack.yaml
|
3992
3992
|
- tracks/haskell/exercises/pangram/test/Tests.hs
|
3993
3993
|
- tracks/haskell/exercises/parallel-letter-frequency/HINTS.md
|
3994
|
+
- tracks/haskell/exercises/parallel-letter-frequency/bench/Benchmark.hs
|
3994
3995
|
- tracks/haskell/exercises/parallel-letter-frequency/examples/success-standard/package.yaml
|
3995
3996
|
- tracks/haskell/exercises/parallel-letter-frequency/examples/success-standard/src/Frequency.hs
|
3996
3997
|
- tracks/haskell/exercises/parallel-letter-frequency/package.yaml
|
@@ -9060,6 +9061,9 @@ files:
|
|
9060
9061
|
- tracks/vimscript/exercises/anagram/anagram.vader
|
9061
9062
|
- tracks/vimscript/exercises/anagram/anagram.vim
|
9062
9063
|
- tracks/vimscript/exercises/anagram/example.vim
|
9064
|
+
- tracks/vimscript/exercises/atbash-cipher/atbash_cipher.vader
|
9065
|
+
- tracks/vimscript/exercises/atbash-cipher/atbash_cipher.vim
|
9066
|
+
- tracks/vimscript/exercises/atbash-cipher/example.vim
|
9063
9067
|
- tracks/vimscript/exercises/bob/bob.vader
|
9064
9068
|
- tracks/vimscript/exercises/bob/bob.vim
|
9065
9069
|
- tracks/vimscript/exercises/bob/example.vim
|
@@ -9081,6 +9085,9 @@ files:
|
|
9081
9085
|
- tracks/vimscript/exercises/rna-transcription/example.vim
|
9082
9086
|
- tracks/vimscript/exercises/rna-transcription/rna_transcription.vader
|
9083
9087
|
- tracks/vimscript/exercises/rna-transcription/rna_transcription.vim
|
9088
|
+
- tracks/vimscript/exercises/word-count/example.vim
|
9089
|
+
- tracks/vimscript/exercises/word-count/word_count.vader
|
9090
|
+
- tracks/vimscript/exercises/word-count/word_count.vim
|
9084
9091
|
- tracks/vimscript/img/icon.png
|
9085
9092
|
homepage: http://exercism.io
|
9086
9093
|
licenses:
|