main_templates2/danube.scala
changeset 350 c5ad0e3f2a6d
parent 349 682611a0fb89
child 396 3ffe978a5664
equal deleted inserted replaced
349:682611a0fb89 350:c5ad0e3f2a6d
   162 // what the recommendations function in (6) produces (this
   162 // what the recommendations function in (6) produces (this
   163 // can take a few seconds). Put all recommendations into a list 
   163 // can take a few seconds). Put all recommendations into a list 
   164 // (of strings) and count how often the strings occur in
   164 // (of strings) and count how often the strings occur in
   165 // this list. This produces a list of string-int pairs,
   165 // this list. This produces a list of string-int pairs,
   166 // where the first component is the movie name and the second
   166 // where the first component is the movie name and the second
   167 // is the number of how many times they were recommended. 
   167 // is the number of how many times the movie was recommended. 
   168 // Sort all the pairs according to the number
   168 // Sort all the pairs according to the number
   169 // of times they were recommended (most recommended movie name 
   169 // of times they were recommended (most recommended movie name 
   170 // first).
   170 // first).
   171 
   171 
   172 def most_recommended(recs: Map[String, List[String]],
   172 def most_recommended(recs: Map[String, List[String]],