{"record":{"id":"d7cb2c90932f938d","repo":"babalae/better-genshin-impact","slug":"match-groups-1-value","errorCode":null,"errorMessage":"未识别的副词条：{match.Groups[1].Value}","messagePattern":"未识别的副词条：(.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"BetterGenshinImpact/GameTask/AutoArtifactSalvage/AutoArtifactSalvageTask.cs","lineNumber":674,"sourceCode":"            else if (match.Groups[1].Value.Contains(dic[ArtifactAffixType.CRITRate]))\n            {\n                artifactAffixType = ArtifactAffixType.CRITRate;\n            }\n            else if (match.Groups[1].Value.Contains(dic[ArtifactAffixType.CRITDMG]))\n            {\n                artifactAffixType = ArtifactAffixType.CRITDMG;\n            }\n            else if (match.Groups[1].Value.Contains(dic[ArtifactAffixType.ElementalMastery]))\n            {\n                artifactAffixType = ArtifactAffixType.ElementalMastery;\n            }\n            else if (match.Groups[1].Value.Contains(dic[ArtifactAffixType.EnergyRecharge]))\n            {\n                artifactAffixType = ArtifactAffixType.EnergyRecharge;\n            }\n            else\n            {\n                throw new Exception($\"未识别的副词条：{match.Groups[1].Value}\");\n            }\n\n            if (!float.TryParse(match.Groups[2].Value.Replace(\"。\", \".\"), NumberStyles.Any, cultureInfo, out float affixValue))\n            {\n                throw new Exception($\"未识别的副词条数值：{match.Groups[2].Value}\");\n            }\n\n            bool isUnactivated = false;\n            // 只有在已经成功识别至少 3 个词条后才执行额外的直方图分析。\n            if (minorAffixes.Count >= 3)\n            {\n                using var lineRoi = levelAndMinorAffixRoi.SubMat(r.Rect);\n                using var lineHistogram = new Mat();\n                Cv2.CalcHist(\n                    images: [lineRoi],\n                    channels: [0],\n                    mask: null,\n                    hist: lineHistogram,","sourceCodeStart":656,"sourceCodeEnd":692,"githubUrl":"https://github.com/babalae/better-genshin-impact/blob/a7cb36712dcb409be610257d877fcea3597e9d6b/BetterGenshinImpact/GameTask/AutoArtifactSalvage/AutoArtifactSalvageTask.cs#L656-L692","documentation":"Thrown during minor-affix parsing when match.Groups[1].Value (the affix name) does not contain any of the localized affix strings in artifactAffixStrDic (ATK/DEF/HP/CRITRate/CRITDMG/ElementalMastery/EnergyRecharge). A line matched the minor-affix regex '^([^+:：]+)\\+([\\d., 。]*)(%?).*$' but its name is not a known stat.","triggerScenarios":"OCR captured a non-affix line that happened to match the 'X+Y' shape (e.g. a set-bonus line, a level line like '+15'); localized affix name OCR'd slightly wrong so .Contains fails; new/unknown affix type not in the dictionary.","commonSituations":"Game language mismatch; OCR substitution errors on stat names; a line from another part of the card bled into levelAndMinorAffixRoi; the artifact has an affix type the dictionary does not cover.","solutions":["Inspect the offending line text (match.Groups[1].Value) via logging.","Confirm language/cultureInfo alignment with the in-game client.","Tighten the regex or pre-filter so set-bonus/level lines are excluded (the code already filters left-aligned regions).","Add the missing affix to ArtifactAffix.DefaultStrDic if it is a legitimate new stat."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { /* minor affix parse loop */ }\ncatch (Exception e) when (e.Message.Contains(\"副词条\")) { if (policy == RecognitionFailurePolicy.Skip) continue; throw; }","preventionTips":["Ensure language/cultureInfo matches the game client.","Filter out set-bonus and level lines before the affix match loop.","Extend ArtifactAffix.DefaultStrDic if a legitimate new affix appears.","Log unrecognized affix names to refine the dictionary."],"tags":["game-task","ocr","artifact","recognition","regex"],"backgroundTag":null,"analyzedSha":"a7cb36712dcb409be610257d877fcea3597e9d6b","analyzedAt":"2026-08-13T16:44:57.548Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}