{"record":{"id":"11a9acc05d1f723e","repo":"Humanizr/Humanizer","slug":"inflection-rule-id-scope-countability-counta","errorCode":null,"errorMessage":"Inflection rule '{id}' scope countability '{countability}' is unsupported.","messagePattern":"Inflection rule '(.+?)' scope countability '(.+?)' is unsupported\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Humanizer.SourceGenerators/Generators/ProfileCatalogs/InflectionCatalogParsing.cs","lineNumber":465,"sourceCode":"                    scope,\n                    $\"Inflection rule '{id}' scope\",\n                    \"pos\", \"countability\", \"token\", \"scripts\");\n                if (GetRequiredScalar(scope, \"pos\", $\"Inflection rule '{id}' scope must define pos\") != \"noun\" ||\n                    GetRequiredScalar(scope, \"token\", $\"Inflection rule '{id}' scope must define token\") != \"standalone\")\n                {\n                    throw new InvalidOperationException(\n                        $\"Inflection rule '{id}' scope must target standalone nouns.\");\n                }\n\n                var countabilities = GetRequiredStrings(\n                    scope,\n                    \"countability\",\n                    $\"Inflection rule '{id}' scope must define countability\");\n                foreach (var countability in countabilities)\n                {\n                    if (!Countabilities.Contains(countability))\n                    {\n                        throw new InvalidOperationException(\n                            $\"Inflection rule '{id}' scope countability '{countability}' is unsupported.\");\n                    }\n                }\n                var ruleScripts = GetRequiredStrings(\n                    scope,\n                    \"scripts\",\n                    $\"Inflection rule '{id}' scope must define scripts\");\n                if (ruleScripts.Any(script => !ownerScripts.Contains(script, StringComparer.Ordinal)))\n                {\n                    throw new InvalidOperationException(\n                        $\"Inflection rule '{id}' scope uses a script not declared by its owner.\");\n                }\n\n                var match = GetRequiredMapping(rule, \"match\", $\"Inflection rule '{id}' must define match\");\n                ValidateProperties(\n                    match,\n                    $\"Inflection rule '{id}' match\",\n                    \"prefix\", \"suffix\", \"precedingNot\", \"preceding-not\");","sourceCodeStart":447,"sourceCodeEnd":483,"githubUrl":"https://github.com/Humanizr/Humanizer/blob/ffc2b77c0f30d2fb176875841424379319d0ae9b/src/Humanizer.SourceGenerators/Generators/ProfileCatalogs/InflectionCatalogParsing.cs#L447-L483","documentation":"Each value in a rule's 'scope.countability' list must be one of count, mass, collective, or plural-only. ParseRules throws when any entry falls outside the supported set.","triggerScenarios":"A scope 'countability' list contains an unsupported value (e.g. 'uncountable', 'countable').","commonSituations":"Typo; using a linguistic term not in the supported set.","solutions":["Use only supported countability values: count, mass, collective, plural-only"],"exampleFix":"# before\n          countability:\n            - 'countable'\n# after\n          countability:\n            - 'count'","handlingStrategy":"validation","validationCode":"var allowed = new[] { \"count\", \"mass\", \"collective\", \"plural-only\" };\nforeach (var rule in rules)\nforeach (var c in rule.Scope.Countability)\n    if (!allowed.Contains(c))\n        Report($\"{locale}: rule '{rule.Id}' scope countability '{c}' unsupported.\");","typeGuard":"static bool ScopeCountabilityValid(IEnumerable<string> cs) =>\n    cs.All(c => c is \"count\" or \"mass\" or \"collective\" or \"plural-only\");","tryCatchPattern":null,"preventionTips":["Reuse the same countability vocabulary across lexemes and rule scopes"],"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"}