{"record":{"id":"1f988da27948fcc8","repo":"babalae/better-genshin-impact","slug":"onnx","errorCode":null,"errorMessage":"未找到物品 ONNX 配套表格。","messagePattern":"未找到物品 ONNX 配套表格。","errorType":"exception","errorClass":"FileNotFoundException","httpStatus":null,"severity":"critical","filePath":"BetterGenshinImpact/GameTask/CharacterDevelopment/WeaponNameMatcher.cs","lineNumber":171,"sourceCode":"            {\n                var substitutionCost = source[sourceIndex - 1] == target[targetIndex - 1] ? 0 : 1;\n                current[sourceIndex] = Math.Min(\n                    Math.Min(current[sourceIndex - 1] + 1, previous[sourceIndex] + 1),\n                    previous[sourceIndex - 1] + substitutionCost);\n            }\n\n            (previous, current) = (current, previous);\n        }\n\n        return previous[source.Length];\n    }\n\n    private static IReadOnlyList<string> LoadWeaponNames()\n    {\n        var path = Global.Absolute(WeaponPrototypePath);\n        if (!File.Exists(path))\n        {\n            throw new FileNotFoundException(\"未找到物品 ONNX 配套表格。\", path);\n        }\n\n        using var parser = new TextFieldParser(path, Encoding.UTF8)\n        {\n            TextFieldType = FieldType.Delimited,\n            HasFieldsEnclosedInQuotes = true,\n            TrimWhiteSpace = false\n        };\n        parser.SetDelimiters(\",\");\n        var headers = parser.ReadFields()\n                      ?? throw new InvalidDataException(\"物品原型表缺少表头。\");\n        var rows = new List<string[]>();\n        while (!parser.EndOfData)\n        {\n            rows.Add(parser.ReadFields()\n                     ?? throw new InvalidDataException(\"物品原型表存在无法读取的记录。\"));\n        }\n","sourceCodeStart":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/babalae/better-genshin-impact/blob/a7cb36712dcb409be610257d877fcea3597e9d6b/BetterGenshinImpact/GameTask/CharacterDevelopment/WeaponNameMatcher.cs#L153-L189","documentation":"Thrown as FileNotFoundException by LoadWeaponNames when File.Exists(path) is false at the expected asset path (Assets/Model/ItemV2/item.csv resolved via Global.Absolute). The weapon name matcher lazily loads this CSV on first use; if the file is absent the entire weapon OCR correction pipeline cannot initialize.","triggerScenarios":"First call to WeaponNameMatcher.Match() when item.csv is missing from the deployment directory, or Global.Absolute resolves to an unexpected base directory.","commonSituations":"The application was deployed without copying Assets to the output directory. A build script excluded large asset files. The working directory or Global.Absolute base path was changed. The user deleted the asset folder.","solutions":["Confirm Assets/Model/ItemV2/item.csv exists relative to the application base directory.","Check the .csproj has the file marked CopyToOutputDirectory and that the build actually copied it.","If the file was deleted, reinstall or rebuild the project."],"exampleFix":"null","handlingStrategy":"validation","validationCode":"var path = Global.Absolute(@\"Assets\\Model\\ItemV2\\item.csv\");\nif (!File.Exists(path)) { /* alert user: missing asset, abort weapon matching */ }","typeGuard":"null","tryCatchPattern":"try { WeaponNameMatcher.Match(text); }\ncatch (FileNotFoundException ex) { /* log missing file path, prompt reinstall */ }","preventionTips":["Ensure the .csproj copies item.csv to the output directory.","Add a startup asset-existence check for critical files."],"tags":["missing-file","csv-data","weapon-matcher","deployment"],"backgroundTag":null,"analyzedSha":"a7cb36712dcb409be610257d877fcea3597e9d6b","analyzedAt":"2026-08-13T16:44:57.548Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}