Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
private def exercise6() {
val list =
Source.fromFile("SonnetI.txt")
.getLines()
.flatMap(line => line.split(WORD_REGEXP))
.map(_.toLowerCase)
.toSeq
.distinct
.sorted
list.foreach(println)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment