author | Christian Urban <urbanc@in.tum.de> |
Tue, 29 Oct 2019 09:54:52 +0000 | |
changeset 278 | 0c2481cd8b1c |
parent 227 | b5f3e814a710 |
child 284 | 9a04eb6a2291 |
permissions | -rw-r--r-- |
227 | 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 |