{"record":{"id":"d3052f33c226c00a","repo":"babalae/better-genshin-impact","slug":"mainaffixvalueline","errorCode":null,"errorMessage":"未识别的主词条数值：{mainAffixValueLine}","messagePattern":"未识别的主词条数值：(.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"BetterGenshinImpact/GameTask/AutoArtifactSalvage/AutoArtifactSalvageTask.cs","lineNumber":605,"sourceCode":"                }\n                if (mainAffixType == ArtifactAffixType.DEF && !String.IsNullOrEmpty(match.Groups[2].Value))\n                {\n                    mainAffixType = ArtifactAffixType.DEFPercent;\n                }\n                if (mainAffixType == ArtifactAffixType.HP && !String.IsNullOrEmpty(match.Groups[2].Value))\n                {\n                    mainAffixType = ArtifactAffixType.HPPercent;\n                }\n                return match.Groups[1].Value;\n            }\n            else\n            {\n                return null;\n            }\n        }).Where(l => l != null).Cast<string>().SingleOrDefault() ?? throw new Exception($\"未找到主词条数值对应的行：\\n{mainAffixText}\");\n        if (!float.TryParse(mainAffixValueLine, NumberStyles.Any, this.cultureInfo, out float value))\n        {\n            throw new Exception($\"未识别的主词条数值：{mainAffixValueLine}\");\n        }\n        ArtifactAffix mainAffix = new ArtifactAffix(mainAffixType, value);\n        #endregion\n\n        #region 副词条\n        var minorAffixes = new List<ArtifactAffix>();\n        string pattern = @\"^([^+:：]+)\\+([\\d., 。]*)(%?).*$\";\n        pattern = pattern.Replace(\"%\", percentStr);\n        foreach (var r in levelAndMinorAffixResult)\n        {\n            Match match = Regex.Match(r.Text, pattern);\n            if (!match.Success)\n            {\n                continue;\n            }\n            ArtifactAffixType artifactAffixType;\n            var dic = this.artifactAffixStrDic;\n            if (match.Groups[1].Value.Contains(dic[ArtifactAffixType.ATK]))","sourceCodeStart":587,"sourceCodeEnd":623,"githubUrl":"https://github.com/babalae/better-genshin-impact/blob/a7cb36712dcb409be610257d877fcea3597e9d6b/BetterGenshinImpact/GameTask/AutoArtifactSalvage/AutoArtifactSalvageTask.cs#L587-L623","documentation":"Thrown when a main-affix value line was found (153 passed) but float.TryParse fails under NumberStyles.Any and the configured cultureInfo. The captured string is not a parseable number, so the main stat magnitude is unknown.","triggerScenarios":"The value line contains trailing/leading junk that slipped through the regex (e.g. a unit symbol, a stray letter); decimal separator mismatch with cultureInfo (e.g. '1.5' parsed under a comma-culture); OCR inserted a space inside the number; value is 'MAX' or non-numeric.","commonSituations":"cultureInfo set to a locale whose decimal separator differs from what OCR emitted; OCR noise characters; a leveled-to-cap artifact showing a non-numeric indicator.","solutions":["Log mainAffixValueLine to see the exact unparseable string.","Align cultureInfo with the in-game locale's number format.","Pre-clean the string (strip non-numeric except the separator) before TryParse.","If the value is genuinely non-numeric for this artifact, handle it as a recognition failure per RecognitionFailurePolicy."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"static string CleanNumber(string s, CultureInfo ci) =>\n    Regex.Replace(s.Replace('。', '.'), ci.NumberFormat.NumberGroupSeparator, \"\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Align cultureInfo with the in-game number locale.","Pre-clean numeric strings before TryParse.","Convert full-width digits to half-width.","Skip the card via RecognitionFailurePolicy when parsing is unreliable."],"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"}