--- a/main_testing2/danube_test4.scala Sat Nov 28 15:58:36 2020 +0000
+++ b/main_testing2/danube_test4.scala Mon Nov 30 00:06:15 2020 +0000
@@ -9,17 +9,17 @@
def urban_get_csv_file(name: String) : List[String] = {
import io.Source
import scala.util._
- val csv = Source.fromFile(name)
+ val csv = Source.fromFile(name)("ISO-8859-1")
csv.mkString.split("\n").toList.drop(1)
}
def urban_process_ratings(lines: List[String]) : List[(String, String)] = {
for (cols <- lines.map(_.split(",").toList);
- if (cols(2).toFloat >= 4)) yield (cols(0), cols(1))
+ if (cols(2).toInt >= 4)) yield (cols(0), cols(1))
}
-val urban_good_ratings = process_ratings(urban_get_csv_file("ratings.csv"))
+val urban_good_ratings = urban_process_ratings(urban_get_csv_file("ratings.csv"))
val urban_ratings_map = urban_groupById(urban_good_ratings)