changeset 227 | b5f3e814a710 |
child 284 | 9a04eb6a2291 |
226:5e489c9fe47b | 227:b5f3e814a710 |
---|---|
1 |
|
2 import io.Source |
|
3 import scala.util._ |
|
4 |
|
5 def urban_get_csv_file(name: String) : List[String] = { |
|
6 val csv = Source.fromFile(name) |
|
7 csv.mkString.split("\n").toList.drop(1) |
|
8 } |
|
9 |
|
10 val urban_ratings = urban_get_csv_file("ratings.csv") |
|
11 val urban_movies = urban_get_csv_file("movies.csv") |
|
12 |
|
13 |
|
14 assert(process_ratings(urban_ratings).length == 48580) |
|
15 |
|
16 assert(process_movies(urban_movies).length == 9742) |
|
17 |
|
18 |