Skip to content

Instantly share code, notes, and snippets.

@stevekrouse
Created May 22, 2013 22:59
Show Gist options
  • Save stevekrouse/5631614 to your computer and use it in GitHub Desktop.
Save stevekrouse/5631614 to your computer and use it in GitHub Desktop.
object WordCount {
def main(args: Array[String]): Unit = {
val files = args.map(Source.fromFile)
vale results = files.
flatMap(_.mkString.split("\\n")).
groupBy(word _> word).
map(group -> (group._1, group._2.size))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment