public void TestUsersElection() { var userQuality = new UserQuality(Program.DefaultQuestionList); const int n = 1000; var quality = userQuality.GetUserInfos().Keys.Select(k => Tuple.Create(k, userQuality.GetUserQuality(k))).OrderByDescending(it => it.Item2).Take(n); Console.WriteLine(String.Join("\n", quality.Select(q => q.Item1 + "\t" + q.Item2))); }
private static void SaveSortedUserQuality(UserQuality userQuality, Func<string, float> func) { var quality = userQuality.GetUserInfos().Keys.OrderByDescending(func).ToDictionary(user => user, func); File.WriteAllText("Users_" + func.Method.Name, String.Join("\n", quality.Select(entry => entry.Key + "\t" + entry.Value))); }