author | Christian Urban <christian.urban@kcl.ac.uk> |
Tue, 07 Dec 2021 23:17:51 +0000 | |
changeset 418 | fa7f7144f2bb |
parent 403 | ffce7b61b446 |
child 422 | 217bbd700594 |
permissions | -rw-r--r-- |
import io.Source import scala.util._ import M2._ def urban_get_csv_file(name: String) : List[String] = { val csv = Source.fromFile(name)("ISO-8859-1") 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)