feat(03-02): add MLS to canonicalization pipeline
- Import MLS_TEAMS from mls module - Add MLS_DIVISIONS dict (Eastern/Western conferences) - Add MLS to sport_mappings for team canonicalization - Add MLS team abbreviation aliases (LA, NYC, RBNY, etc.) - Add MLS stadium historical aliases (BMO, PayPal Park, Shell Energy, etc.) Total teams: 154 (30 MLS teams added) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -19,6 +19,7 @@ from typing import Optional
|
||||
|
||||
# Import team mappings from scraper
|
||||
from scrape_schedules import NBA_TEAMS, MLB_TEAMS, NHL_TEAMS, NFL_TEAMS
|
||||
from mls import MLS_TEAMS
|
||||
|
||||
|
||||
# =============================================================================
|
||||
@@ -216,6 +217,41 @@ NFL_DIVISIONS = {
|
||||
'SEA': ('nfl_nfc', 'nfl_nfc_west'),
|
||||
}
|
||||
|
||||
MLS_DIVISIONS = {
|
||||
# Eastern Conference (MLS uses conferences, not divisions)
|
||||
'ATL': ('mls_eastern', None),
|
||||
'CHI': ('mls_eastern', None),
|
||||
'CIN': ('mls_eastern', None),
|
||||
'CLB': ('mls_eastern', None),
|
||||
'CLT': ('mls_eastern', None),
|
||||
'DC': ('mls_eastern', None),
|
||||
'MIA': ('mls_eastern', None),
|
||||
'MTL': ('mls_eastern', None),
|
||||
'NE': ('mls_eastern', None),
|
||||
'NYCFC': ('mls_eastern', None),
|
||||
'NYRB': ('mls_eastern', None),
|
||||
'ORL': ('mls_eastern', None),
|
||||
'PHI': ('mls_eastern', None),
|
||||
'TOR': ('mls_eastern', None),
|
||||
# Western Conference
|
||||
'AUS': ('mls_western', None),
|
||||
'COL': ('mls_western', None),
|
||||
'DAL': ('mls_western', None),
|
||||
'HOU': ('mls_western', None),
|
||||
'LAFC': ('mls_western', None),
|
||||
'LAG': ('mls_western', None),
|
||||
'MIN': ('mls_western', None),
|
||||
'NSH': ('mls_western', None),
|
||||
'POR': ('mls_western', None),
|
||||
'RSL': ('mls_western', None),
|
||||
'SD': ('mls_western', None),
|
||||
'SEA': ('mls_western', None),
|
||||
'SJ': ('mls_western', None),
|
||||
'SKC': ('mls_western', None),
|
||||
'STL': ('mls_western', None),
|
||||
'VAN': ('mls_western', None),
|
||||
}
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# FUZZY MATCHING
|
||||
@@ -374,6 +410,7 @@ def canonicalize_teams(
|
||||
'MLB': MLB_DIVISIONS,
|
||||
'NHL': NHL_DIVISIONS,
|
||||
'NFL': NFL_DIVISIONS,
|
||||
'MLS': MLS_DIVISIONS,
|
||||
}.get(sport, {})
|
||||
|
||||
for abbrev, info in team_mappings.items():
|
||||
@@ -447,6 +484,7 @@ def canonicalize_all_teams(
|
||||
('MLB', MLB_TEAMS),
|
||||
('NHL', NHL_TEAMS),
|
||||
('NFL', NFL_TEAMS),
|
||||
('MLS', MLS_TEAMS),
|
||||
]
|
||||
|
||||
for sport, team_map in sport_mappings:
|
||||
|
||||
Reference in New Issue
Block a user