Expand description
Presentation / dispatch helpers ported from num2words2/__init__.py.
These three functions were the last pieces of pure-Python logic living in
the num2words2 binder: language-code resolution, the style=
post-processing, and the cents= mode mapping. They are conversion-agnostic
string/enum transforms, so they belong in the pure core rather than the
Python surface. The PyO3 binder classifies the caller’s arguments into the
plain types below and calls these directly.
Enums§
- Cents
Arg - The
cents=argument as the binder classifies the caller’s Python object.
Functions§
- apply_
style style=presentation post-processing (issues #535, #562), mirroringnum2words2.__init__._apply_style. Operates on the rendered string, so it is conversion-independent:- normalize_
cents cents='omit'|'verbose'|'terse'-> the legacy bool the core expects (issue #554), mirroringnum2words2.__init__._normalize_centsplus the caller’s follow-up_cents in (True, False)guard.- resolve_
lang - Resolve a caller’s language code to a core key, mirroring the historic
dispatcher (
num2words2.__init__._normalize_lang):