Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def wordCounter(text: String): scala.collection.mutable.Map[String,Int] = {
- new HashMap[String,Int] ++ text.trim.split("\\s+").groupBy(x => x).mapValues(_.length)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement