Humanizr/Humanizer · error · InvalidOperationException
Inflection lexeme '{id}' pos must be 'noun'.
Error message
Inflection lexeme '{id}' pos must be 'noun'. What it means
The inflection engine currently only inflects nouns, so each lexeme's 'pos' must be the literal string 'noun'. ParseLexemes throws for any other value.
Source
Thrown at src/Humanizer.SourceGenerators/Generators/ProfileCatalogs/InflectionCatalogParsing.cs:262
{
if (value is not SimpleYamlMapping lexeme)
{
throw new InvalidOperationException("Inflection lexemes must be mappings.");
}
ValidateProperties(
lexeme,
"Inflection lexeme",
"id", "pos", "countability", "sense", "forms", "sources");
var id = GetRequiredScalar(lexeme, "id", "Inflection lexeme must define id");
if (!ids.Add(id))
{
throw new InvalidOperationException($"Duplicate inflection lexeme id '{id}'.");
}
if (GetRequiredScalar(lexeme, "pos", $"Inflection lexeme '{id}' must define pos") != "noun")
{
throw new InvalidOperationException($"Inflection lexeme '{id}' pos must be 'noun'.");
}
var countability = GetRequiredScalar(
lexeme,
"countability",
$"Inflection lexeme '{id}' must define countability");
if (!Countabilities.Contains(countability))
{
throw new InvalidOperationException(
$"Inflection lexeme '{id}' countability '{countability}' is unsupported.");
}
string? sense = null;
if (lexeme.TryGetValue("sense", out var senseValue))
{
if (senseValue is not SimpleYamlScalar senseScalar ||
string.IsNullOrWhiteSpace(senseScalar.Value))
{View on GitHub (pinned to ffc2b77c0f)
Solutions
- Set 'pos: 'noun'' exactly
- Omit the lexeme until its part of speech is supported
Example fix
# before
- id: 'zz.verb.run'
pos: 'verb'
# after
- id: 'zz.noun.cat'
pos: 'noun' Defensive patterns
Strategy: validation
Validate before calling
foreach (var lexeme in lexemes)
if (lexeme.Pos != "noun")
Report($"{locale}: lexeme '{lexeme.Id}' pos must be 'noun'."); Type guard
static bool AllPosNoun(IEnumerable<Lexeme> lexemes) =>
lexemes.All(l => l.Pos == "noun"); Prevention
- The engine currently supports only nouns; do not author other parts of speech
When it happens
Trigger: A lexeme has 'pos: verb', 'pos: adjective', or any value other than 'noun'.
Common situations: Modeling non-noun parts of speech before the engine supports them; a typo such as 'Noun' (the check is ordinal/case-sensitive).
Related errors
- Inflection defines unsupported quantity selector; expected '
- Inflection quantitySelector 'exact-numeric-singleton' requir
- Inflection quantitySelector 'exact-numeric-singleton' cannot
- Inflection display category 'one' is unreachable without qua
- Active inflection bundle must define lexemes.
AI-assisted analysis of Humanizr/Humanizer@ffc2b77c0f (2026-08-13).
Data as JSON: /api/errors/af87ea25826d99ca.
Report an issue: GitHub.