Skip to content

Commit 3d17149

Browse files
committed
Replaces War and Peace with "The Catcher in the Rye"
1 parent 7035d66 commit 3d17149

File tree

4 files changed

+1454
-5
lines changed

4 files changed

+1454
-5
lines changed

.gitattributes

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
kotlin-spark-api/src/main/kotlin/org/jetbrains/spark/api/VarArities.kt linguist-generated
2-
examples/src/main/resources/voina-i-mir.txt filter=lfs diff=lfs merge=lfs -text

examples/src/main/kotlin/org/jetbrains/spark/api/examples/WordCount.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ fun main() {
2828
withSpark {
2929
spark
3030
.read()
31-
.textFile(this::class.java.classLoader.getResource("voina-i-mir.txt")?.path)
31+
.textFile(this::class.java.classLoader.getResource("the-catcher-in-the-rye.txt")?.path)
3232
.map { it.split(Regex("\\s")) }
3333
.flatten()
3434
.cleanup()
@@ -44,4 +44,5 @@ fun main() {
4444
fun Dataset<String>.cleanup() =
4545
filter { it.isNotBlank() }
4646
.map { it.trim(',', ' ', '\n', ':', '.', ';', '?', '!', '"', '\'', '\t', ' ') }
47+
.filter { !it.endsWith("n’t") }
4748
.filter { it.length >= MEANINGFUL_WORD_LENGTH }

0 commit comments

Comments
 (0)