Gist Overview: Create a comprehensive list of English words with MacOS.
Copy /usr/share/dict/words as words.txt
(async () => {
const fs = require('fs');
const readline = require('readline');
const file_stream = fs.createReadStream('words.txt');
const readline_interface = readline.createInterface({ input: file_stream, crlfDelay: Infinity });
const dictionary_path = 'dictionary.txt';
fs.unlinkSync(dictionary_path);
for await (const word of readline_interface) {
const valid_length = word.length > 2; // remove 2-letter words
const valid_case = !/^[A-Z]/.test(word); // remove proper names and places
const is_valid = [valid_length,valid_case].every(rule => !!rule);
if(!is_valid) continue;
fs.appendFileSync(dictionary_path, `${word}\n`);
console.log(word)
}
console.log('Finished...')
})();