1
fdhdd 2017 年 5 月 22 日
相当于 wordcount 吧
val f = scala.io.Source.fromFile("yourFile") val wordCount = f.getLines.map(_.split(" ")).flatMap(a => a).groupBy(identity).mapValues(_.length) |