diff --git a/classify_makes.py b/classify_makes.py index b72a0a8..e458dcd 100644 --- a/classify_makes.py +++ b/classify_makes.py @@ -211,6 +211,23 @@ def _royal_ry(orig_sn): return s.startswith('RY') and len(s) >= 6 ROYAL_RY = (_royal_ry, 'Royal', 'GIII', 'Bev', 'low') +# ─── Short DN serals (8-digit formats seen in DB) ────────────────────────── +# DN has 8-digit serials: 11440039, 11495117, 24110016, 24220045, etc. +# Narrow prefix rules to avoid false positives with Royal (1100xxxx) or Crane + +def _dn_8digit_short(sn_clean): + """8-digit DN serials with specific known prefixes.""" + return (len(sn_clean) == 8 and sn_clean.isdigit() and + (sn_clean.startswith('114') or sn_clean.startswith('241') or + sn_clean.startswith('1149') or sn_clean.startswith('2411'))) +DN_SHORT_8 = (_dn_8digit_short, 'DN', 'BevMax/5800/3800/200E', 'GF Bev', 'medium') + +# 10-digit 76/77 prefix → DN (e.g., 76820565BD, 76920191BD, 77090262AE) +def _dn_76_77(sn_clean): + """10-digit serials starting with 76 or 77 → DN.""" + return len(sn_clean) == 10 and sn_clean.isdigit() and sn_clean[:2] in ('76', '77') +DN_76_77 = (_dn_76_77, 'DN', 'BevMax/5800/3800/200E', 'Bev', 'medium') + # ─── RULE COLLECTION (ordered: first match wins) ─────────────────────────── RULES = [ @@ -231,6 +248,8 @@ RULES = [ ('AMS dash', AMS_DASH), ('AMS long', AMS_LONG), ('DN specific prefixes', DN_RULE), + ('DN short 8-digit', DN_SHORT_8), + ('DN 76/77 10-digit', DN_76_77), ('DN broad 11x', DN_BROAD), ('Vendo 8-digit 00', VENDO_8), ('Royal BA/PA suffix', ROYAL_SUFFIX),