From d58d52c5e7dd6ff9f7b8d4c60f4c10d58eb91a87 Mon Sep 17 00:00:00 2001 From: Mikhail Chusavitin Date: Thu, 9 Apr 2026 15:07:25 +0300 Subject: [PATCH] fix: include model number and ADA suffix in GPU article token MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit RTX 6000 ADA and A6000 are distinct cards — RTX_4000_ADA_SFF now produces RTX4000ADA instead of RTX, avoiding visual ambiguity with the segment separator (10xRTX4000ADA vs 10xRTX-1x…). Co-Authored-By: Claude Sonnet 4.6 --- internal/article/generator.go | 36 +++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/internal/article/generator.go b/internal/article/generator.go index cf7ee6a..71b7aa5 100644 --- a/internal/article/generator.go +++ b/internal/article/generator.go @@ -329,33 +329,57 @@ func parseGPUModel(lotName string) string { } parts := strings.Split(upper, "_") model := "" + numSuffix := "" mem := "" for i, p := range parts { if p == "" { continue } switch p { - case "NV", "NVIDIA", "INTEL", "AMD", "RADEON", "PCIE", "PCI", "SXM", "SXMX": + case "NV", "NVIDIA", "INTEL", "AMD", "RADEON", "PCIE", "PCI", "SXM", "SXMX", "SFF", "LOVELACE", "AMPERE", "HOPPER": + continue + case "ADA": + if model != "" { + numSuffix += "ADA" + } continue default: if strings.Contains(p, "GB") { mem = p continue } - if model == "" && (i > 0) { + if model == "" && i > 0 { model = p + } else if model != "" && numSuffix == "" && isNumeric(p) { + numSuffix = p } } } - if model != "" && mem != "" { - return model + "_" + mem + full := model + if numSuffix != "" { + full = model + numSuffix } - if model != "" { - return model + if full != "" && mem != "" { + return full + "_" + mem + } + if full != "" { + return full } return normalizeModelToken(lotName) } +func isNumeric(s string) bool { + if s == "" { + return false + } + for _, r := range s { + if r < '0' || r > '9' { + return false + } + } + return true +} + func parseMemGiB(lotName string) int { if m := reMemTiB.FindStringSubmatch(lotName); len(m) == 3 { return atoi(m[1]) * 1024