This document describes the stacked dictionary pattern used in Letter Punk: a word is accepted if either a primary dictionary or a fallback dictionary recognizes it.
The goal is practical completeness for players while keeping dictionary curation under control for developers.
A single dictionary source often creates false negatives for real gameplay words.
Stacking two dictionaries gives better coverage:
en_US.dic + .aff expansion).3of6game.txt).On a real attempt at solving a daily board, these three words were used:
LONGDISTALBARGEDValidation result by source:
| Word | Primary | Fallback | Outcome |
|---|---|---|---|
| LONG | yes | yes | accepted |
| DISTAL | yes | no | accepted |
| BARGED | no | yes | accepted |
This is the exact behavior you want from a stacked strategy: each source covers gaps in the other, and good solve paths are not blocked by one list’s omissions.
Letter Punk uses two packed trie files:
public/util/compressed-dictionary.txt (primary)public/util/compressed-dictionary-fallback.txt (fallback, optional)At runtime:
isWord(word).primary, fallback, or both) for optional UI/debug display.The dictionary compiler:
en_US.dic + .aff preferred, then scowl.txt, then 3of6game.txt)3of6game.txt when that source is distinct from primarydictionary-overrides.txt and subtracts dictionary-blocklist.txt for both sourcespublic/util/dictionary-source-report.json (full unique-word lists)public/util/dictionary-source-report.md (human-readable diff preview)Source-provenance badges are useful for debugging and dictionary tuning, but can add visual noise for players.
A practical default:
If you are building a word game with curated constraints:
This pattern generally increases acceptance quality without sacrificing maintainability.