Skip to content

fontlabapp.proof.random · declarations 001

Back to fontlabapp.proof.random

MODES module-attribute

MODES: tuple[Mode, ...]

Mode module-attribute

Mode

generate

generate(mode: Mode, *, rng: Random | None = None) -> str

Build one complete source-defined proof using module RNG or injected RNG.

Numbers: 200 digit draws alternating with divisor draws from [2,3]. Non-text: 700 letter draws alternating with divisors [3,5,7]. At each index append one space exactly when index % chosen_divisor == 0, including zero. Words: one draw per a..z bucket, one trailing space per chosen entry, then apply lower/title/upper to the whole text. No sorting, trimming or filtering.

word_dictionary

word_dictionary() -> dict[str, list[str]]

Read all 4,991 source entries, retaining duplicate/compound words and order.

Return fresh data so a caller cannot change a later proof's dictionary. Package read/JSON failures propagate before the caller opens a native tab.