feat: Add FE colleges and improve education institution matching
- Add notable Further Education colleges to recognised institutions (Loughborough College, Hartpury College, etc.) - Improve compound name matching to handle separators (/, &, -, ,) so "Loughborough College/Motorsport UK Academy" now matches 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -168,6 +168,19 @@ public static class UKInstitutions
|
|||||||
"Cranfield School of Management",
|
"Cranfield School of Management",
|
||||||
"Ashridge Business School",
|
"Ashridge Business School",
|
||||||
"Alliance Manchester Business School",
|
"Alliance Manchester Business School",
|
||||||
|
|
||||||
|
// Notable Further Education Colleges
|
||||||
|
"Loughborough College",
|
||||||
|
"City of Bristol College",
|
||||||
|
"Newcastle College",
|
||||||
|
"Leeds City College",
|
||||||
|
"City College Norwich",
|
||||||
|
"Weston College",
|
||||||
|
"Chichester College",
|
||||||
|
"Hartpury College",
|
||||||
|
"Myerscough College",
|
||||||
|
"Plumpton College",
|
||||||
|
"Writtle University College",
|
||||||
};
|
};
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -270,7 +283,35 @@ public static class UKInstitutions
|
|||||||
if (NameVariations.TryGetValue(normalised, out var officialName))
|
if (NameVariations.TryGetValue(normalised, out var officialName))
|
||||||
return officialName;
|
return officialName;
|
||||||
|
|
||||||
// Fuzzy match
|
// Handle compound names (e.g., "Loughborough College/Motorsport UK Academy")
|
||||||
|
// Split by common separators and check each part
|
||||||
|
var separators = new[] { '/', '&', '-', '–', '—', ',' };
|
||||||
|
if (normalised.IndexOfAny(separators) >= 0)
|
||||||
|
{
|
||||||
|
var parts = normalised.Split(separators, StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries);
|
||||||
|
foreach (var part in parts)
|
||||||
|
{
|
||||||
|
// Try direct match on part
|
||||||
|
if (RecognisedInstitutions.Contains(part))
|
||||||
|
return part;
|
||||||
|
|
||||||
|
// Try variation match on part
|
||||||
|
if (NameVariations.TryGetValue(part, out var partOfficialName))
|
||||||
|
return partOfficialName;
|
||||||
|
|
||||||
|
// Try fuzzy match on part
|
||||||
|
foreach (var institution in RecognisedInstitutions)
|
||||||
|
{
|
||||||
|
if (institution.Contains(part, StringComparison.OrdinalIgnoreCase) ||
|
||||||
|
part.Contains(institution, StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
return institution;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fuzzy match on full name
|
||||||
foreach (var institution in RecognisedInstitutions)
|
foreach (var institution in RecognisedInstitutions)
|
||||||
{
|
{
|
||||||
if (institution.Contains(normalised, StringComparison.OrdinalIgnoreCase) ||
|
if (institution.Contains(normalised, StringComparison.OrdinalIgnoreCase) ||
|
||||||
|
|||||||
Reference in New Issue
Block a user