Bug Fixes: enrolment, assignment and search order

This commit is contained in:
Gary Sharp
2014-04-22 13:55:46 +10:00
parent 74df073b29
commit 3cf6d5475d
22 changed files with 310 additions and 127 deletions
@@ -103,5 +103,20 @@ namespace Disco
return final_score;
}
/// <summary>
/// A fuzzy string search algorithm.
///
/// Based on: ScoreSharp (https://github.com/bltavares/scoresharp)
/// Based on: string_score from Joshaven Potter (https://github.com/joshaven/string_score)
///
/// MIT License
/// </summary>
public static double Score(this IEnumerable<string> Sources, string Test, double Fuzziness = 0)
{
return Sources
.Where(s => s != null)
.Select(s => s.Score(Test, Fuzziness))
.Average();
}
}
}