1
edit
Changes
→Full Program
...
val t1WordCount = text1.flatMap(line => line.split(" ")).mapcount(word => (word, 1)).reduceByKey((a, b) => a + b)
val t1SentenceCount = text1.flatMap(line => line.split("")).filter(character => character = ".").count()