Created
February 20, 2012 23:31
-
-
Save devth/1872287 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Build filtered, sorted map of compared ratings | |
val compared = ListMap( | |
productFeatureComparison.getProductComparedRatings.asScala.toMap | |
// Filter out products that have no offers | |
.filterNot { case (pid, _) => lowestOffer(products.get(pid)) == None} | |
// Sort by similarity descending | |
.sortBy{-_._2.getSimilarity}:_*) | |
// Use the first 10 | |
.take(10) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment