379
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
1 |
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
2 |
import CW7b._
|
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
3 |
|
384
|
4 |
val urban_recs =
|
|
5 |
Map("1" -> List("b", "a"),
|
|
6 |
"2" -> List("y", "x"),
|
|
7 |
"3" -> List("a", "c"))
|
379
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
8 |
|
384
|
9 |
val urban_names = Map("a" -> "A", "b" -> "B", "c" -> "C", "x" -> "X", "y" -> "Y")
|
379
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
10 |
|
384
|
11 |
assert(most_recommended(urban_recs, urban_names).toSet ==
|
|
12 |
Set(("A",2), ("B",1), ("C",1), ("X",1), ("Y",1)))
|
379
Christian Urban <christian.urban@kcl.ac.uk>
parents:
diff
changeset
|
13 |
|