{
  "schema": "leumas.docs.page/1",
  "id": "adapter:domain/word",
  "slug": "adapters/domain/word",
  "kind": "capabilities",
  "bucket": "package",
  "title": "word — word-games & word-play pack",
  "name": "word",
  "eyebrow": "word-games & word-play pack",
  "chip": null,
  "summary": "Word-games & word-play capability pack (pure JS, zero deps, ships its own ~3.2k common-word dictionary): find anagrams and check isAnagram, compute Scrabble tile scores, play Wordle (per-position...",
  "keywords": [
    "word",
    "word-games",
    "word-play",
    "common-word",
    "anagrams",
    "isanagram",
    "scrabble",
    "wordle"
  ],
  "audience": "both",
  "funnel": {
    "product": null,
    "cta": null
  },
  "body": "# word — word-games & word-play pack\n\nA self-contained pack of word games and word-play tools. Pure JS, **zero npm deps** (Node built-ins\nonly). Ships its own compact common-word dictionary in `data/common-words.json` (~3.2k lowercase\n`a–z` words, lengths 2–9) so every dictionary-backed tool works offline and deterministically.\n\n## What it is\n\nAnagram finding & checking, Scrabble scoring, Wordle (feedback + candidate solving), letter\nunscrambling, palindrome checks, syllable counting, suffix-heuristic rhyming, hangman word picks,\nword-ladder chains, and letter counting — plus a few handy extras. It's the **word games** corner of\nthe ecosystem; it plays *with* words rather than transforming or analyzing text.\n\n## Tools\n\n| Tool | Args | Returns |\n|---|---|---|\n| `anagrams` | `{ word, includeSelf? }` | dictionary words that are full anagrams of `word` |\n| `isAnagram` | `{ a, b }` | do `a` and `b` use exactly the same letters? |\n| `scrabbleScore` | `{ word }` | Scrabble tile value + per-letter breakdown |\n| `wordleFeedback` | `{ guess, answer }` | per-position `green`/`yellow`/`grey` + pattern (`GYG__`) |\n| `wordleCandidates` | `{ constraints }` | dictionary words matching greens/yellows/greys/length |\n| `unscramble` | `{ letters, full?, min? }` | words from a scramble (anagram, or Boggle-style sub-words) |\n| `isPalindrome` | `{ word }` | same forwards & backwards? (ignores case/spaces/punct) |\n| `syllableCount` | `{ word }` | heuristic English syllable count (per-word for phrases) |\n| `rhymesWith` | `{ word, min?, limit? }` | suffix-heuristic rhymes, best (longest shared tail) first |\n| `hangmanWord` | `{ difficulty?, seed? }` | a random word by difficulty band + masked template |\n| `wordChain` | `{ start, end?, steps?, seed? }` | word ladder (one letter at a time); BFS shortest path |\n| `countLetters` | `{ word \\| text }` | letter frequency table + vowel/consonant tallies |\n| `isWord` | `{ word }` | is `word` in the built-in dictionary? |\n| `wordInfo` | `{ word }` | one-shot profile: length, syllables, score, palindrome, anagrams |\n| `pangramCheck` | `{ text }` | uses every letter A–Z? reports missing letters |\n| `acronym` | `{ text, stopwords? }` | acronym from first letters of each word |\n\n### Wordle constraints (`wordleCandidates`)\n\n```json\n{\n  \"greens\":  [{ \"letter\": \"c\", \"position\": 0 }],\n  \"yellows\": [{ \"letter\": \"r\", \"position\": 2 }],\n  \"greys\":   [\"s\", \"t\", \"n\"],\n  \"length\":  5\n}\n```\n\nGreen = right letter, right spot. Yellow = right letter, wrong spot. Grey = absent (duplicate-safe:\na letter that is green/yellow elsewhere is not excluded). Results are ranked by unique-letter\nfrequency so the most information-rich guesses come first.\n\n## Usage\n\n```js\nimport word from './index.js';\n\nword.adapters.anagrams({ word: 'listen' });\n// { word: 'listen', count: n, anagrams: ['enlist','silent','tinsel', ...] }\n\nword.adapters.wordleFeedback({ guess: 'crane', answer: 'cadre' });\n// { pattern: 'G_Y_Y', feedback: [...], solved: false }\n\nword.adapters.wordChain({ start: 'cold', end: 'warm' });\n// { steps: n, chain: ['cold','cord','word','ward','warm'] }\n\nword.adapters.scrabbleScore({ word: 'quiz' });\n// { word: 'quiz', score: 22, breakdown: [...] }\n```\n\nRandomized tools (`hangmanWord`, `wordChain` without an `end`) accept an optional numeric `seed` for\nreproducible output; omit it for `Math.random()`. Everything else is a pure function of its input.\n\n## Dataset\n\n`data/common-words.json` — a plain JSON array of ~3.2k lowercase `a–z` words (lengths 2–9),\nsorted and deduped. Chosen for broad game usefulness (common English vocabulary), not exhaustive\ncoverage — so anagram/rhyme/ladder results are curated and fast rather than dictionary-complete.\n\n## DRY boundary\n\n- **`a-text`** owns **string transforms** — case conversion, ciphers (Caesar/ROT13/Vigenère),\n  digests, base64/encoding, stemming. Reach for it to *reshape* a string.\n- **`nlp`** owns **corpus analysis** — sentiment, keyword extraction, summarization, readability,\n  entity extraction over documents. Reach for it to *analyze text*.\n- **`word`** (here) owns **games & play over a dictionary** — anagrams, Scrabble, Wordle, rhymes,\n  hangman, word ladders, syllables, letter counting.\n\nIf you're transforming a string → `a-text`. Analyzing a document → `nlp`. Playing *with* words →\nyou're in the right place.\n",
  "source": {
    "path": "shared/engines/adapters/domain/word/README.md",
    "blobSha": "",
    "commit": "",
    "committedAt": "",
    "provenance": "no-git",
    "bytes": 4588,
    "hash": "922f2b96d55f036f3076ff5a15b894e3f3b58de9"
  },
  "urls": {
    "html": "/p/adapters/domain/word",
    "json": "/docs/adapters/domain/word.json",
    "md": "/docs/adapters/domain/word.md"
  },
  "links": {
    "composes": [],
    "usedBy": [],
    "product": [],
    "howTo": [],
    "skills": []
  }
}
