Skip to content

SAIF.Business.Utilities business rules

This page captures business rules enforced by TitleCase.ToTitleCase and mdlTextConversion.NumberToText.

BR-UTIL-001 Blank or null input passthrough

Field Value
Statement If the input string is Nothing or empty/whitespace-only after trimming, ToTitleCase returns the input unchanged.
Trigger Call to TitleCase.ToTitleCase (or its .ToTitleCase() extension) with a null, empty, or whitespace-only string.
Enforcement TitleCase.ToTitleCase, guard clause at method entry; also a second guard after tokenization if the split yields no non-empty tokens.
Outcome Original (unchanged) string is returned.
Source SAIF.Business.Utilities\TitleCase.vb

BR-UTIL-002 Mixed-case tokens are left untouched

Field Value
Statement A token that already contains both an upper-case and a lower-case letter is returned as-is, without any case transformation.
Trigger TitleCaseSingleWord is called on a token containing mixed case (e.g., an already-formatted name fragment).
Enforcement TitleCase.TitleCaseSingleWord, first conditional check.
Outcome Token is preserved exactly as supplied.
Source SAIF.Business.Utilities\TitleCase.vb

BR-UTIL-003 Known all-caps abbreviations stay upper case

Field Value
Statement If a token (case-insensitively) matches an entry in the curated abbreviation list (organization/degree/state/direction codes such as SAIF, LLC, LLP, MD, JD, NE, NW, OR, CA, WA, etc.), the token is rendered fully upper case.
Trigger TitleCaseSingleWord on a token whose upper-cased form is a member of UpperCaseWordList.
Enforcement TitleCase.TitleCaseSingleWord, UpperCaseWordList lookup branch.
Outcome Token rendered in all upper case (e.g., SAIF, LLC, OR).
Source SAIF.Business.Utilities\TitleCase.vb

BR-UTIL-004 Known connector words stay lower case

Field Value
Statement If a token (case-insensitively) matches a small set of connector/filler words (is, in, the, an, of, on, and, de), the token is rendered fully lower case (except where the whole-string first-letter-uppercase rule, BR-UTIL-009, applies).
Trigger TitleCaseSingleWord on a token whose lower-cased form is a member of LowerCaseWordList.
Enforcement TitleCase.TitleCaseSingleWord, LowerCaseWordList lookup branch.
Outcome Token rendered in lower case.
Source SAIF.Business.Utilities\TitleCase.vb

BR-UTIL-005 Known mixed-case exception words are normalized

Field Value
Statement If a token (case-insensitively) matches a curated mixed-case exception (PhD, LaCombe), the token is replaced with the exact canonical mixed-case spelling from the list, regardless of the casing supplied by the caller.
Trigger TitleCaseSingleWord on a token whose lower-cased form matches an entry (lower-cased) in MixedCaseWordList.
Enforcement TitleCase.TitleCaseSingleWord, MixedCaseWordList lookup branch.
Outcome Token rendered as the canonical form, e.g., PHD → PhD, lacombe → LaCombe.
Source SAIF.Business.Utilities\TitleCase.vb

BR-UTIL-006 Ordinal number suffixes are lower-cased

Field Value
Statement A token consisting of a numeric prefix followed by an ordinal suffix (st, nd, rd, th) is rendered with the number unchanged and the suffix lower-cased (e.g., 52ND → 52nd).
Trigger TitleCaseSingleWord on a token where HasNumberSuffix returns true (the token splits into a purely numeric part and a recognized ordinal-suffix part).
Enforcement TitleCase.TitleCaseSingleWord → HasNumberSuffix / GetNumberSuffixParts.
Outcome Token rendered as {number}{lowercased-suffix}.
Source SAIF.Business.Utilities\TitleCase.vb

BR-UTIL-007 Mc O'-style prefixes get a second inner capital

Field Value
Statement After the primary casing pass, if the resulting token starts with a recognized name prefix (Mc, O'), the remainder of the token after the prefix is separately proper-cased, producing names like McMahon or (in combination with other rules) O'Brien-style capitalization.
Trigger TitleCaseSingleWord on a token whose (post-primary-casing) value starts with Mc or O'.
Enforcement TitleCase.TitleCaseSingleWord, MixedCasePrefixList branch (applied after the main upper/lower/mixed/ordinal branch, on the else-path result of word.ToProperCase).
Outcome Token rendered with an inner capital after the prefix, e.g., MCMAHON → McMahon.
Source SAIF.Business.Utilities\TitleCase.vb

BR-UTIL-008 Possessive 's suffix is preserved in original case

Field Value
Statement A trailing 's suffix on a space-delimited word is re-applied verbatim from the source word (not re-derived from the tokenized/title-cased word), so possessive forms like MIKE'S are handled correctly even though the regex tokenizer splits on the apostrophe.
Trigger Final pass in ToTitleCase over each space-delimited word of the reassembled output, when the word (case-insensitively) ends with 's.
Enforcement TitleCase.ApplyExactSuffixList, invoked from ToTitleCase after ReassembleString.
Outcome The longest matching suffix from MixedCaseSuffixList is spliced back onto the word unchanged.
Source SAIF.Business.Utilities\TitleCase.vb

BR-UTIL-009 First character of output is always forced to upper case

Field Value
Statement Regardless of what word-level casing rules produced, the very first character of the final ToTitleCase output is always converted to upper case before returning.
Trigger End of every ToTitleCase call (after tokenization, reassembly, and suffix handling).
Enforcement TitleCase.ToTitleCase, final Return output.Substring(0, 1).ToUpper & output.Substring(1) statement.
Outcome The formatted string always begins with an upper-case character, even if the first token would otherwise have been lower-cased (e.g., a leading connector word).
Source SAIF.Business.Utilities\TitleCase.vb

BR-UTIL-010 NumberToText upper bound is enforced

Field Value
Statement Numbers greater than 999,999,999,999,999 (the trillions ceiling) are rejected; the function does not support values beyond this magnitude.
Trigger Call to mdlTextConversion.NumberToText with n > 999999999999999.
Enforcement mdlTextConversion.NumberToText, first guard clause.
Outcome Throws ApplicationException("Number too large to convert to text. Limit is 999,999,999,999,999.").
Source SAIF.Business.Utilities\mdlTextConversion.vb

BR-UTIL-011 Zero renders as an empty string, not the word "Zero"

Field Value
Statement Calling NumberToText with 0 returns an empty string rather than the word "Zero".
Trigger NumberToText(0) (including the zero-remainder base case reached during recursion, e.g., spelling "One Hundred " with no remaining digits).
Enforcement mdlTextConversion.NumberToText, n = 0 branch.
Outcome Empty string is returned/appended, meaning a whole-hundred/thousand/etc. value has no trailing "Zero" text.
Source SAIF.Business.Utilities\mdlTextConversion.vb

Sources

  • SAIF.Business.Utilities\TitleCase.vb
  • SAIF.Business.Utilities\mdlTextConversion.vb
  • .saifdocgen/state/runs/20260821-113120-claims-bof-web-legal/analysis/TSK007-analysis.md