more words

This commit is contained in:
2026-10-24 14:29:08 -04:00
parent eae0dba308
commit f07b5fdadf
13 changed files with 3563 additions and 434 deletions

View File

@@ -1,22 +1,9 @@
import fs from 'node:fs';
import wordlistEnglish from 'wordlist-english';
const validTwo = new Set([
'am', 'an', 'as', 'at', 'be', 'by', 'do', 'go', 'he', 'hi',
'if', 'in', 'is', 'it', 'me', 'my', 'no', 'of', 'oh', 'on',
'or', 'so', 'to', 'up', 'us', 'we'
]);
import { buildWordSet } from './lexicon-sources.mjs';
// Build a clean, high-frequency recognized vocabulary for client-side unlimited/custom puzzles
const vocabulary = new Set();
for (const word of wordlistEnglish.english) {
const w = word.toLowerCase().trim();
if (w.length === 2 && validTwo.has(w)) {
vocabulary.add(w);
} else if (w.length >= 3 && w.length <= 16 && /^[a-z]+$/.test(w)) {
vocabulary.add(w);
}
}
// (includes regional spellings and the proper-word allowlist)
const vocabulary = buildWordSet();
console.log('Total vocabulary words:', vocabulary.size);