Permalink
Browse files

Extracted CalculateSimilarityScore method.

  • Loading branch information...
1 parent b3b1061 commit d379f94c0653a82a4868f8a2a54396388de381a4 @robertgreiner committed Nov 9, 2011
Showing with 6 additions and 2 deletions.
  1. +6 −2 Recommender/RankReviewers.cs
@@ -18,9 +18,13 @@ public RankReviewers(Reviewer currentUser, List<Reviewer> reviewers)
public IOrderedEnumerable<KeyValuePair<Reviewer, double>> Rank()
{
- var scores = Reviewers.ToDictionary(r => r, r => new PearsonCorrelation(CurrentUser, r).Score());
-
+ var scores = Reviewers.ToDictionary(r => r, CalculateSimilarityScore);
return scores.OrderByDescending(key => key.Value);
}
+
+ private double CalculateSimilarityScore(Reviewer reviewer)
+ {
+ return new PearsonCorrelation(CurrentUser, reviewer).Score();
+ }
}
}

0 comments on commit d379f94

Please sign in to comment.