{"record":{"id":"51f3c855a8420a3b","repo":"Humanizr/Humanizer","slug":"inflection-lexeme-id-countability-countabili","errorCode":null,"errorMessage":"Inflection lexeme '{id}' countability '{countability}' is unsupported.","messagePattern":"Inflection lexeme '(.+?)' countability '(.+?)' is unsupported\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Humanizer.SourceGenerators/Generators/ProfileCatalogs/InflectionCatalogParsing.cs","lineNumber":271,"sourceCode":"                    \"id\", \"pos\", \"countability\", \"sense\", \"forms\", \"sources\");\n                var id = GetRequiredScalar(lexeme, \"id\", \"Inflection lexeme must define id\");\n                if (!ids.Add(id))\n                {\n                    throw new InvalidOperationException($\"Duplicate inflection lexeme id '{id}'.\");\n                }\n\n                if (GetRequiredScalar(lexeme, \"pos\", $\"Inflection lexeme '{id}' must define pos\") != \"noun\")\n                {\n                    throw new InvalidOperationException($\"Inflection lexeme '{id}' pos must be 'noun'.\");\n                }\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\");","sourceCodeStart":253,"sourceCodeEnd":289,"githubUrl":"https://github.com/Humanizr/Humanizer/blob/ffc2b77c0f30d2fb176875841424379319d0ae9b/src/Humanizer.SourceGenerators/Generators/ProfileCatalogs/InflectionCatalogParsing.cs#L253-L289","documentation":"A lexeme's 'countability' must be one of the supported set: 'count', 'mass', 'collective', 'plural-only'. ParseLexemes throws for any value outside that set.","triggerScenarios":"A lexeme sets 'countability:' to a value not in {count, mass, collective, plural-only}.","commonSituations":"Using a linguistic term not in the set (e.g. 'uncountable' instead of 'mass', or 'countable' instead of 'count'); a typo.","solutions":["Use one of: count, mass, collective, plural-only"],"exampleFix":"# before\n        countability: 'uncountable'\n# after\n        countability: 'mass'","handlingStrategy":"validation","validationCode":"var allowed = new[] { \"count\", \"mass\", \"collective\", \"plural-only\" };\nforeach (var lexeme in lexemes)\n    if (!allowed.Contains(lexeme.Countability))\n        Report($\"{locale}: lexeme '{lexeme.Id}' countability '{lexeme.Countability}' unsupported.\");","typeGuard":"static bool CountabilitySupported(string c) =>\n    c is \"count\" or \"mass\" or \"collective\" or \"plural-only\";","tryCatchPattern":null,"preventionTips":["Use 'mass' (not 'uncountable') and 'count' (not 'countable')"],"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"}