{"record":{"id":"9bcb70ff8e053886","repo":"Humanizr/Humanizer","slug":"inflection-lexeme-id-sense-must-be-a-non-empty","errorCode":null,"errorMessage":"Inflection lexeme '{id}' sense must be a non-empty scalar.","messagePattern":"Inflection lexeme '(.+?)' sense must be a non-empty scalar\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Humanizer.SourceGenerators/Generators/ProfileCatalogs/InflectionCatalogParsing.cs","lineNumber":281,"sourceCode":"                }\n\n                var countability = GetRequiredScalar(\n                    lexeme,\n                    \"countability\",\n                    $\"Inflection lexeme '{id}' must define countability\");\n                if (!Countabilities.Contains(countability))\n                {\n                    throw new InvalidOperationException(\n                        $\"Inflection lexeme '{id}' countability '{countability}' is unsupported.\");\n                }\n\n                string? sense = null;\n                if (lexeme.TryGetValue(\"sense\", out var senseValue))\n                {\n                    if (senseValue is not SimpleYamlScalar senseScalar ||\n                        string.IsNullOrWhiteSpace(senseScalar.Value))\n                    {\n                        throw new InvalidOperationException(\n                            $\"Inflection lexeme '{id}' sense must be a non-empty scalar.\");\n                    }\n\n                    sense = senseScalar.Value;\n                }\n\n                ValidateSources(lexeme, sourceIds, $\"Inflection lexeme '{id}'\");\n                var forms = GetRequiredMapping(lexeme, \"forms\", $\"Inflection lexeme '{id}' must define forms\");\n                ValidateProperties(\n                    forms,\n                    $\"Inflection lexeme '{id}' forms\",\n                    \"singular\", \"dictionaryPlural\", \"dictionary-plural\", \"display\");\n                var singular = ParseForm(forms, \"singular\", alternateName: null, id, ownerScripts, casing);\n                var dictionaryPlural = ParseForm(\n                    forms,\n                    \"dictionaryPlural\",\n                    \"dictionary-plural\",\n                    id,","sourceCodeStart":263,"sourceCodeEnd":299,"githubUrl":"https://github.com/Humanizr/Humanizer/blob/ffc2b77c0f30d2fb176875841424379319d0ae9b/src/Humanizer.SourceGenerators/Generators/ProfileCatalogs/InflectionCatalogParsing.cs#L263-L299","documentation":"The optional 'sense:' field disambiguates homographs; if present it must be a single non-empty, non-whitespace scalar string. ParseLexemes throws when 'sense:' is empty, whitespace-only, a sequence/mapping, or null.","triggerScenarios":"'sense:' is an empty quoted string, whitespace-only, a list, or a bare 'sense:' that YAML parses as null.","commonSituations":"Leaving 'sense: ''' as a placeholder; writing 'sense:' with no value.","solutions":["Provide a non-empty scalar for 'sense:'","Remove the 'sense:' key entirely if no disambiguation is needed"],"exampleFix":"# before\n        sense: ''\n# after\n        sense: 'the animal'\n# (or remove the key)","handlingStrategy":"validation","validationCode":"foreach (var lexeme in lexemes)\n    if (lexeme.TryGetValue(\"sense\", out var s) &&\n        (s is not SimpleYamlScalar sc || string.IsNullOrWhiteSpace(sc.Value)))\n        Report($\"{locale}: lexeme '{lexeme.Id}' sense must be a non-empty scalar.\");","typeGuard":"static bool SenseValid(SimpleYamlMapping lexeme) =>\n    !lexeme.TryGetValue(\"sense\", out var s) ||\n    (s is SimpleYamlScalar sc && !string.IsNullOrWhiteSpace(sc.Value));","tryCatchPattern":null,"preventionTips":["Omit 'sense:' when not needed; never leave it as an empty placeholder"],"tags":["inflection","localization","yaml","source-generator","locale","validation"],"backgroundTag":null,"analyzedSha":"ffc2b77c0f30d2fb176875841424379319d0ae9b","analyzedAt":"2026-08-13T21:42:34.584Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}