Word pool combinatorial generation
Generates thousands of unique predictions from small curated word pools using combinatorial assembly.
Problem
Static lists of pre-written responses require ongoing maintenance, repeat quickly, and become stale. Storing thousands of literal strings bloats the binary. AI-generated responses require network access and add latency.
Solution
Define subject, verb, and outcome pools as arrays of strings. Assemble predictions at runtime by sampling one element from each pool and substituting into sentence templates. Varied template structures (declarative, conditional, question-form) produce output that feels diverse even from small pools.
FortuneTeller adds a 17% humor injection chance — 17% of the time a humor template is chosen instead of the category-specific template, producing surprise variety.
Usage
Apply for any feature that needs high-variety text output without network dependency. Keep pools small and high quality — 20 strong entries per pool produce better output than 100 mediocre ones. Document any magic numbers like humor probability in code comments with rationale.
Avoid for content that requires factual accuracy or personalization; this pattern is best suited to entertainment, placeholder text, or lorem-ipsum-style generation.
Trade-offs
- Pro: Offline, zero latency, effectively infinite variety from small data; no dependency on external services.
- Con: Output can feel formula-driven to power users who recognize patterns; humor injection at a fixed rate can surprise users who expect category-consistent results.
Context
Subjects + verbs + outcomes with varied sentence structures.
Reusability
- Score: 3/5
- Used in: FortuneTeller
Source
Synced from ops-core learning data. Original source: FortuneTeller