marking2/danube_test2.scala
author Christian Urban <urbanc@in.tum.de>
Thu, 06 Dec 2018 18:50:53 +0000
changeset 234 c51305a2217f
parent 227 b5f3e814a710
child 284 9a04eb6a2291
permissions -rw-r--r--
updated


import io.Source
import scala.util._

def urban_get_csv_file(name: String) : List[String] = {
  val csv = Source.fromFile(name)
  csv.mkString.split("\n").toList.drop(1)
}

val urban_ratings = urban_get_csv_file("ratings.csv")
val urban_movies = urban_get_csv_file("movies.csv")


assert(process_ratings(urban_ratings).length == 48580)

assert(process_movies(urban_movies).length == 9742)