{"record":{"id":"ab0d4e9c4316dd3e","repo":"Humanizr/Humanizer","slug":"indian-scale-form-number-profiles-require-a-scale-ab0d4e","errorCode":null,"errorMessage":"Indian scale-form number profiles require a scale value covered by the dense unit map range.","messagePattern":"Indian scale-form number profiles require a scale value covered by the dense unit map range\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Humanizer/Localisation/NumberToWords/IndianScaleFormNumberToWordsConverter.cs","lineNumber":153,"sourceCode":"    public FrozenDictionary<int, string> OrdinalMap { get; } = ordinalMap ?? FrozenDictionary<int, string>.Empty;\n    /// <summary>Gets terminal cardinal-token replacements used to form ordinals.</summary>\n    public FrozenDictionary<string, string> OrdinalTerminalReplacements { get; } = ordinalTerminalReplacements ?? FrozenDictionary<string, string>.Empty;\n\n    static string[] ValidateDenseUnitsMap(string[] value)\n    {\n        if (value.Length < 100)\n        {\n            throw new InvalidOperationException(\"Indian scale-form number profiles require dense words for 0 through 99.\");\n        }\n\n        return value;\n    }\n\n    static IndianScaleForm[] ValidateScales(IndianScaleForm[] value, int denseUnitCount)\n    {\n        if (value.Length == 0 || value[^1].Value > denseUnitCount)\n        {\n            throw new InvalidOperationException(\"Indian scale-form number profiles require a scale value covered by the dense unit map range.\");\n        }\n\n        for (var i = 0; i < value.Length; i++)\n        {\n            if (value[i].Value <= 0)\n            {\n                throw new InvalidOperationException(\"Indian scale-form number profiles require positive scale values.\");\n            }\n\n            if (i > 0 && value[i - 1].Value <= value[i].Value)\n            {\n                throw new InvalidOperationException(\"Indian scale-form number profiles require scales in descending order.\");\n            }\n        }\n\n        return value;\n    }\n}","sourceCodeStart":135,"sourceCodeEnd":171,"githubUrl":"https://github.com/Humanizr/Humanizer/blob/ffc2b77c0f30d2fb176875841424379319d0ae9b/src/Humanizer/Localisation/NumberToWords/IndianScaleFormNumberToWordsConverter.cs#L135-L171","documentation":"Profile constructor validation: the scales array must be non-empty and its smallest (last) scale Value must not exceed the dense unit map count. Thrown at instantiation when scales are empty or the lowest scale starts above where dense words end, leaving an uncovered gap.","triggerScenarios":"First converter use for an IndianScaleForm culture whose scales array is empty or whose value[^1].Value > denseUnitsMap.Length.","commonSituations":"Locale YAML missing scales entirely, or scales whose lowest value sits above the dense map ceiling.","solutions":["Report the locale bug — scales are missing or start above the dense range.","Use a locale with a complete scale table.","If authoring, ensure scales are non-empty and the smallest scale Value <= dense map length."],"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(\"scale value covered by the dense unit map range\"))\n{\n    words = value.ToWords(CultureInfo.InvariantCulture);\n}","preventionTips":["Smoke-test converter resolution per locale at startup.","Report empty/misaligned scale 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"}