main_marking2/danube_test2.scala
changeset 389 4113d4d8cf62
child 424 daf561a83ba6
equal deleted inserted replaced
388:ed63dca8068a 389:4113d4d8cf62
       
     1 
       
     2 import io.Source
       
     3 import scala.util._
       
     4 
       
     5 import CW7b._
       
     6 
       
     7 def urban_get_csv_file(name: String) : List[String] = {
       
     8   val csv = Source.fromFile(name)
       
     9   csv.mkString.split("\n").toList.drop(1)
       
    10 }
       
    11 
       
    12 val urban_ratings = urban_get_csv_file("ratings.csv")
       
    13 val urban_movies = urban_get_csv_file("movies.csv")
       
    14 
       
    15 
       
    16 assert(process_ratings(urban_ratings).length == 48580)
       
    17 
       
    18 assert(process_movies(urban_movies).length == 9742)
       
    19 
       
    20