more words
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user