Open main menu

CDOT Wiki β

Changes

The Real A Team

50 bytes removed, 11:47, 5 April 2016
Full Program
val t1WordCount = text1.flatMap(line => line.split(" ")).count()
val t1SentenceCount t1SplitChars = text1.flatMap(line => line.split("")).cache()  val t1SentenceCount = t1SplitChars.filter(character => character.matches("[.!?]")).count() val t1CommaCount = text1.flatMap(line => line.split(""))t1SplitChars.filter(character => character.matches("[,]")).count() val t1ColonCount = text1.flatMap(line => line.split(""))t1SplitChars.filter(character => character.matches("[:;]")).count() val t1CharacterCount = text1.flatMap(line => line.split(""))t1SplitChars.count() val t1ParagraphCount = text1.flatMap(line => line.split(""))t1SplitChars.filter(character => character.matches("[\n]")).count()