1
fdhdd 2017-05-22 17:48:25 +08:00
相当于 wordcount 吧
val f = scala.io.Source.fromFile("yourFile") val wordCount = f.getLines.map(_.split(" ")).flatMap(a => a).groupBy(identity).mapValues(_.length) |