{"record":{"id":"cdb95b7ff7b59de2","repo":"babalae/better-genshin-impact","slug":"match-groups-2-value","errorCode":null,"errorMessage":"未识别的副词条数值：{match.Groups[2].Value}","messagePattern":"未识别的副词条数值：(.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"BetterGenshinImpact/GameTask/AutoArtifactSalvage/AutoArtifactSalvageTask.cs","lineNumber":679,"sourceCode":"            {\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,\n                    dims: 1,\n                    histSize: [256],\n                    ranges: [new Rangef(0, 256)]\n                );\n                lineHistogram.GetArray(out float[] histogramFrequencies);","sourceCodeStart":661,"sourceCodeEnd":697,"githubUrl":"https://github.com/babalae/better-genshin-impact/blob/a7cb36712dcb409be610257d877fcea3597e9d6b/BetterGenshinImpact/GameTask/AutoArtifactSalvage/AutoArtifactSalvageTask.cs#L661-L697","documentation":"Thrown when the minor-affix name was recognized (155 passed) but float.TryParse on match.Groups[2].Value (with '。' replaced by '.') fails under NumberStyles.Any and cultureInfo. The numeric portion of the affix is not parseable.","triggerScenarios":"The captured value contains separators or characters not allowed by NumberStyles.Any under the culture (e.g. a thousands grouping that the culture rejects); OCR inserted noise into the digits; the value is empty or non-numeric.","commonSituations":"Decimal/thousands separator mismatch between OCR output and cultureInfo; OCR artifacts in the number; full-width digits or other numeral forms not converted.","solutions":["Log match.Groups[2].Value to inspect the raw number text.","Ensure cultureInfo matches the in-game number locale; convert full-width digits before parse.","Pre-clean the value (strip spaces, normalize separators) before TryParse.","Fall back to RecognitionFailurePolicy.Skip if parsing remains unreliable."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"static bool TryParseAffixValue(string raw, CultureInfo ci, out float v) =>\n    float.TryParse(raw.Replace('。', '.').Replace(\" \", \"\"), NumberStyles.Any, ci, out v);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Normalize separators ('。' -> '.') and strip spaces before parsing.","Confirm cultureInfo matches OCR number format.","Apply RecognitionFailurePolicy.Skip for unreliable values."],"tags":["game-task","ocr","artifact","parsing","culture"],"backgroundTag":null,"analyzedSha":"a7cb36712dcb409be610257d877fcea3597e9d6b","analyzedAt":"2026-08-13T16:44:57.548Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}