feat: add optional student nickname for informal display
Keep legal first and last names for formal lists; show DisplayFirstName on teams, calendars, and import matching so two Josiahs can be told apart. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -23,7 +23,14 @@ public static class FuzzyStudentMatcher
|
||||
|
||||
public static int Score(Student student, string name)
|
||||
{
|
||||
var candidates = new[] { student.Name, student.FirstNameLastName, student.LastNameFirstName };
|
||||
var candidates = new[]
|
||||
{
|
||||
student.Name,
|
||||
student.FirstNameLastName,
|
||||
student.LastNameFirstName,
|
||||
student.DisplayFirstName,
|
||||
student.Nickname
|
||||
}.Where(c => !string.IsNullOrWhiteSpace(c));
|
||||
return candidates.Max(candidate => Math.Max(Fuzz.Ratio(candidate, name), Fuzz.TokenSetRatio(candidate, name)));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user