Skip to content

Instantly share code, notes, and snippets.

@gilbertw1
Last active December 24, 2015 14:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gilbertw1/6815827 to your computer and use it in GitHub Desktop.
Save gilbertw1/6815827 to your computer and use it in GitHub Desktop.
Source
.fromFile("biglist.txt")
.getLines
.foldLeft(mutable.Map[String,Int]()) { (m,w) =>
m(w) = m.getOrElseUpdate(w,0)+1; m
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment