Created
May 22, 2013 22:59
-
-
Save stevekrouse/5631614 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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