letter-punk

Dual Dictionary Validation for Word-Chain Games

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.

Why Stack Dictionaries

A single dictionary source often creates false negatives for real gameplay words.

Stacking two dictionaries gives better coverage:

Real Puzzle Example

On a real attempt at solving a daily board, these three words were used:

Validation 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.

Runtime Behavior

Letter Punk uses two packed trie files:

At runtime:

  1. Load both packed tries (fallback may be missing by design in some builds).
  2. Query both for isWord(word).
  3. Accept if either returns true.
  4. Keep source metadata (primary, fallback, or both) for optional UI/debug display.

Build-Time Pipeline

The dictionary compiler:

UX Recommendation

Source-provenance badges are useful for debugging and dictionary tuning, but can add visual noise for players.

A practical default:

Guidance for Other Game Developers

If you are building a word game with curated constraints:

This pattern generally increases acceptance quality without sacrificing maintainability.