1
edit
Changes
→Full Program
val t1WordCount = text1.flatMap(line => line.split(" ")).count()
val t1SplitChars = text1.flatMap(line => line.split("")).cache()
val t1SentenceCount = t1SplitChars.filter(character => character.matches("[.!?]")).count()