Game-Ready Dictionary is a high-performance, pre-compiled, Trie-based word validation library designed specifically for web-based game development.
Whether you're building a word puzzle, a roguelite with lexical mechanics, or a professional Scrabble clone, this library provides O(m) lookup speeds and zero-latency validation with zero external dependencies.
- โก Blazing Fast: Lookups in ~0.0001ms using pre-compiled Trie structures.
- ๐ Dialect Support: Built-in support for US (American) and UK (British) English spelling variations.
- ๐ฆ Tiered Assets: Choose between
Small,Medium, andLargetiers to balance bundle size and vocabulary depth. - ๐ก๏ธ Game-Ready: Automatically filtered for profanity and restricted trademarks.
- ๐ ๏ธ SEO & Web Optimized: Designed for modern bundlers (Vite, Webpack) and fully environment-agnostic (works in Browser & Node).
- ๐ Professional Data: Sourced from industry standards like ENABLE1, 12Dicts, and SCOWL.
npm install @rahulmrx/game-ready-dictionaryThe most efficient way to validate words in a game loop.
import { TrieEngine } from '@rahulmrx/game-ready-dictionary';
import trieData from '@rahulmrx/game-ready-dictionary/data'; // Defaults to Medium
const trie = new TrieEngine(trieData);
// O(m) Validation - Complexity depends on word length, not dictionary size
if (trie.validate('apple')) {
console.log('Valid word found!');
}
// Prefix Search - Perfect for autocomplete or pruning search paths
const suggestions = trie.getPrefixMatches('anti');Handle spelling variations like color vs colour with ease.
import usData from '@rahulmrx/game-ready-dictionary/us';
import ukData from '@rahulmrx/game-ready-dictionary/uk';
const usTrie = new TrieEngine(usData);
const ukTrie = new TrieEngine(ukData);
console.log(usTrie.validate('color')); // true
console.log(ukTrie.validate('color')); // false| Tier | Word Count | Data Source | Use Case |
|---|---|---|---|
| Small | ~7,000 | 12Dicts โฉ Top 10k Google English | Casual mobile games, wordle clones. |
| Medium | ~60,000 | Full 12Dicts (5desk) | Standard crosswords, word search, roguelites. |
| Large | ~182,000 | ENABLE1 + 12Dicts Superset | Pro-grade validation, deep-strategy games. |
| Dialects | US / UK | SCOWL (Standard Level 60) | Dialect-specific spelling (color vs colour). |
Measured on a standard Node.js runtime:
| Metric | Small Tier | Medium Tier | Large Tier |
|---|---|---|---|
| Load Time | 0.5ms | 25ms | 70ms |
| Avg Lookup | 0.004ms | 0.0001ms | 0.0001ms |
TrieEngine provides sub-microsecond lookups regardless of dictionary size.
Contributions are welcome! Please see CONTRIBUTING.md for details.
Designed with โค๏ธ for Game Developers.