trackler 2.0.6.29 → 2.0.6.30
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/trackler/version.rb +1 -1
- data/tracks/c/README.md +2 -2
- data/tracks/c/config.json +7 -0
- data/tracks/c/exercises/binary/makefile +16 -0
- data/tracks/c/exercises/binary/src/example.c +17 -0
- data/tracks/c/exercises/binary/src/example.h +7 -0
- data/tracks/c/exercises/binary/test/test_binary.c +99 -0
- data/tracks/c/exercises/binary/test/vendor/unity.c +1300 -0
- data/tracks/c/exercises/binary/test/vendor/unity.h +274 -0
- data/tracks/c/exercises/binary/test/vendor/unity_internals.h +701 -0
- data/tracks/csharp/exercises/scrabble-score/ScrabbleScoreTest.cs +7 -0
- data/tracks/delphi/config.json +8 -0
- data/tracks/delphi/docs/RESOURCES.md +20 -0
- data/tracks/delphi/exercises/beer-song/uBeerSongTests.pas +48 -15
- data/tracks/delphi/exercises/hello-world/uHelloWorldExample.pas +2 -12
- data/tracks/delphi/exercises/hello-world/uTestHelloWorld.pas +3 -3
- data/tracks/delphi/exercises/rna-transcription/TestRnaTranscription.dpr +60 -0
- data/tracks/delphi/exercises/rna-transcription/uRnaTranscriptionExample.pas +55 -0
- data/tracks/delphi/exercises/rna-transcription/uTestRnaTranscription.pas +88 -0
- data/tracks/go/config.json +4 -2
- data/tracks/julia/exercises/anagram/example.jl +29 -30
- data/tracks/julia/exercises/anagram/runtests.jl +16 -17
- data/tracks/julia/exercises/bob/example.jl +1 -1
- data/tracks/julia/exercises/hamming/example.jl +0 -1
- data/tracks/julia/exercises/leap/runtests.jl +4 -5
- data/tracks/julia/exercises/raindrops/example.jl +9 -9
- data/tracks/julia/exercises/raindrops/runtests.jl +54 -54
- data/tracks/julia/exercises/rna-transcription/example.jl +5 -6
- data/tracks/julia/exercises/rna-transcription/runtests.jl +22 -23
- data/tracks/julia/exercises/scrabble-score/example.jl +7 -7
- data/tracks/julia/exercises/scrabble-score/runtests.jl +12 -12
- data/tracks/julia/exercises/trinary/example.jl +2 -2
- data/tracks/julia/exercises/trinary/runtests.jl +11 -11
- data/tracks/julia/exercises/word-count/example.jl +7 -7
- data/tracks/julia/exercises/word-count/runtests.jl +11 -11
- data/tracks/scala/docs/INSTALLATION.md +18 -2
- metadata +12 -2
@@ -1,9 +1,9 @@
|
|
1
1
|
function wordcount(sentence::AbstractString)
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
2
|
+
sentence = lowercase(sentence)
|
3
|
+
words = Dict()
|
4
|
+
for rx = eachmatch(r"[a-z]+'[a-z]+|[0-9a-z]+", sentence)
|
5
|
+
word = rx.match
|
6
|
+
words[word] = get(words, word, 0) + 1
|
7
|
+
end
|
8
|
+
words
|
9
9
|
end
|
@@ -3,45 +3,45 @@ using Base.Test
|
|
3
3
|
include("word-count.jl")
|
4
4
|
|
5
5
|
@testset "no words" begin
|
6
|
-
|
6
|
+
@test wordcount(" .\n,\t!^&*()~@#\$%{}[]:;'/<>") == Dict()
|
7
7
|
end
|
8
8
|
|
9
9
|
@testset "count one word" begin
|
10
|
-
|
10
|
+
@test wordcount("word") == Dict("word" => 1)
|
11
11
|
end
|
12
12
|
|
13
13
|
@testset "count one of each word" begin
|
14
|
-
|
14
|
+
@test wordcount("one of each") == Dict("one" => 1, "of" => 1, "each" => 1)
|
15
15
|
end
|
16
16
|
|
17
17
|
@testset "multiple occurrences of a word" begin
|
18
|
-
|
18
|
+
@test wordcount("one fish two fish red fish blue fish") == Dict("one" => 1, "fish" => 4, "two" => 1, "red" => 1, "blue" => 1)
|
19
19
|
end
|
20
20
|
|
21
21
|
@testset "handles cramped lists" begin
|
22
|
-
|
22
|
+
@test wordcount("one,two,three") == Dict("one" => 1, "two" => 1, "three" => 1)
|
23
23
|
end
|
24
24
|
|
25
25
|
@testset "handles expanded lists" begin
|
26
|
-
|
26
|
+
@test wordcount("one,\ntwo,\nthree") == Dict("one" => 1, "two" => 1, "three" => 1)
|
27
27
|
end
|
28
28
|
|
29
29
|
@testset "ignore punctuation" begin
|
30
|
-
|
30
|
+
@test wordcount("car: carpet as java: javascript!!&@\$%^&") == Dict("car" => 1, "carpet" => 1, "as" => 1, "java" => 1, "javascript" => 1)
|
31
31
|
end
|
32
32
|
|
33
33
|
@testset "include numbers" begin
|
34
|
-
|
34
|
+
@test wordcount("testing, 1, 2 testing") == Dict("testing" => 2, "1" => 1, "2" => 1)
|
35
35
|
end
|
36
36
|
|
37
37
|
@testset "normalize case" begin
|
38
|
-
|
38
|
+
@test wordcount("go Go GO Stop stop") == Dict("go" => 3, "stop" => 2)
|
39
39
|
end
|
40
40
|
|
41
41
|
@testset "with apostrophes" begin
|
42
|
-
|
42
|
+
@test wordcount("First: don't laugh. Then: don't cry.") == Dict("first" => 1, "don't" => 2, "laugh" => 1, "then" => 1, "cry" => 1)
|
43
43
|
end
|
44
44
|
|
45
45
|
@testset "with quotations" begin
|
46
|
-
|
46
|
+
@test wordcount("Joe can't tell between 'large' and large.") == Dict("joe" => 1, "can't" => 1, "tell" => 1, "between" => 1, "large" => 2, "and" => 1)
|
47
47
|
end
|
@@ -1,5 +1,21 @@
|
|
1
1
|
## Installing [Scala](http://www.scala-lang.org)
|
2
2
|
|
3
|
-
* [Download](http://www.java.com/en/) and install the Java runtime version 1.6 or later
|
4
|
-
* [Download](http://www.scala-sbt.org/release/docs/Getting-Started/Setup.html) and install the Simple Build Tool (`sbt`)
|
5
3
|
|
4
|
+
In addition to the exercism CLI and your favorite text editor, practicing with Exercism exercises in Scala requires:
|
5
|
+
|
6
|
+
* Recent build of the Java 8 Platform, such as [OpenJDK](http://openjdk.java.net/install/) or [Oracle Java JDK](http://www.oracle.com/technetwork/java/javase/downloads/index.html)
|
7
|
+
* [Download](http://www.scala-sbt.org/release/docs/Setup.html) and install the Simple Build Tool (`sbt`)
|
8
|
+
|
9
|
+
---
|
10
|
+
|
11
|
+
After installing Java and `sbt` you will be ready to get started with the Scala track of Exercism.
|
12
|
+
|
13
|
+
To get started, see "[Running the Tests](http://exercism.io/languages/scala/tests)".
|
14
|
+
|
15
|
+
---
|
16
|
+
|
17
|
+
# Scala IDEs
|
18
|
+
|
19
|
+
* [IntelliJ IDEA with Scala Plugin](https://www.jetbrains.com/idea/)
|
20
|
+
* [ScalaIDE](http://scala-ide.org/index.html)
|
21
|
+
* [NetBeans with Scala Plugin](https://netbeans.org/)
|
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.0.6.
|
4
|
+
version: 2.0.6.30
|
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-02-
|
11
|
+
date: 2017-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubyzip
|
@@ -584,6 +584,13 @@ files:
|
|
584
584
|
- tracks/c/exercises/binary-search/test/vendor/unity.c
|
585
585
|
- tracks/c/exercises/binary-search/test/vendor/unity.h
|
586
586
|
- tracks/c/exercises/binary-search/test/vendor/unity_internals.h
|
587
|
+
- tracks/c/exercises/binary/makefile
|
588
|
+
- tracks/c/exercises/binary/src/example.c
|
589
|
+
- tracks/c/exercises/binary/src/example.h
|
590
|
+
- tracks/c/exercises/binary/test/test_binary.c
|
591
|
+
- tracks/c/exercises/binary/test/vendor/unity.c
|
592
|
+
- tracks/c/exercises/binary/test/vendor/unity.h
|
593
|
+
- tracks/c/exercises/binary/test/vendor/unity_internals.h
|
587
594
|
- tracks/c/exercises/bob/makefile
|
588
595
|
- tracks/c/exercises/bob/src/example.c
|
589
596
|
- tracks/c/exercises/bob/src/example.h
|
@@ -1624,6 +1631,9 @@ files:
|
|
1624
1631
|
- tracks/delphi/exercises/phone-number/PhoneNumberTests.dpr
|
1625
1632
|
- tracks/delphi/exercises/phone-number/uPhoneNumberExample.pas
|
1626
1633
|
- tracks/delphi/exercises/phone-number/uPhoneNumberTests.pas
|
1634
|
+
- tracks/delphi/exercises/rna-transcription/TestRnaTranscription.dpr
|
1635
|
+
- tracks/delphi/exercises/rna-transcription/uRnaTranscriptionExample.pas
|
1636
|
+
- tracks/delphi/exercises/rna-transcription/uTestRnaTranscription.pas
|
1627
1637
|
- tracks/delphi/exercises/saddle-points/TestSaddlePoints.dpr
|
1628
1638
|
- tracks/delphi/exercises/saddle-points/uSaddlePointsExample.pas
|
1629
1639
|
- tracks/delphi/exercises/saddle-points/uSaddlePointsTests.pas
|