{"record":{"id":"5b5fd9618d9066c2","repo":"Humanizr/Humanizer","slug":"linked-vigesimal-number-profiles-require-at-least","errorCode":null,"errorMessage":"Linked-vigesimal number profiles require at least a zero word.","messagePattern":"Linked-vigesimal number profiles require at least a zero word\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Humanizer/Localisation/NumberToWords/LinkedVigesimalNumberToWordsConverter.cs","lineNumber":180,"sourceCode":"\n    /// <summary>Gets the terminal low-remainder linker for the rendered remainder.</summary>\n    public string GetTerminalRemainderJoiner(string renderedRemainder)\n    {\n        if (TerminalRemainderAlternateJoiner.Length > 0 &&\n            renderedRemainder.Length > 0 &&\n            TerminalRemainderAlternateJoinerInitials.Contains(renderedRemainder[0]))\n        {\n            return TerminalRemainderAlternateJoiner;\n        }\n\n        return TerminalRemainderJoiner;\n    }\n\n    static string[] ValidateWords(string[] value)\n    {\n        if (value.Length == 0)\n        {\n            throw new InvalidOperationException(\"Linked-vigesimal number profiles require at least a zero word.\");\n        }\n\n        return value;\n    }\n\n    static LinkedVigesimalScale[] ValidateScales(LinkedVigesimalScale[] value)\n    {\n        for (var i = 0; i < value.Length; i++)\n        {\n            if (value[i].Value <= 0)\n            {\n                throw new InvalidOperationException(\"Linked-vigesimal number profiles require positive scale values.\");\n            }\n\n            if (i > 0 && value[i - 1].Value <= value[i].Value)\n            {\n                throw new InvalidOperationException(\"Linked-vigesimal number profiles require descending scales.\");\n            }","sourceCodeStart":162,"sourceCodeEnd":198,"githubUrl":"https://github.com/Humanizr/Humanizer/blob/ffc2b77c0f30d2fb176875841424379319d0ae9b/src/Humanizer/Localisation/NumberToWords/LinkedVigesimalNumberToWordsConverter.cs#L162-L198","documentation":"Profile constructor validation: the Words table must contain at least a zero word (length > 0). An empty table is rejected at instantiation.","triggerScenarios":"First converter use for a linked-vigesimal culture whose words array is empty.","commonSituations":"Locale YAML missing the lexicalized words list entirely.","solutions":["Report the locale bug — the words table is empty.","Use a locale with a populated words table.","If authoring, provide at least the zero word in the locale YAML."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Construction-time validation; no public pre-check. Isolate converter resolution per culture.","typeGuard":null,"tryCatchPattern":"string words;\ntry\n{\n    words = value.ToWords(culture);\n}\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"at least a zero word\"))\n{\n    words = value.ToWords(CultureInfo.InvariantCulture);\n}","preventionTips":["Smoke-test converter resolution per locale at startup.","Report empty word tables upstream.","Pin consistent Humanizer versions."],"tags":["number-to-words","profile-data","localization","construction-validation"],"backgroundTag":null,"analyzedSha":"ffc2b77c0f30d2fb176875841424379319d0ae9b","analyzedAt":"2026-08-13T21:42:34.584Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}