scrabble-solver
Version:
Scrabble Solver 2 - Free, open-source, cross-platform, multi-language analysis tool for Scrabble, Scrabble Duel, Super Scrabble, Letter League, Crossplay, Literaki, and Kelimelik. Quickly find the top-scoring words using the given board and tiles.
15 lines (14 loc) • 630 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.downloadDictionary = void 0;
const trie_1 = require("@kamilmielnik/trie");
const logger_1 = require("@scrabble-solver/logger");
const word_lists_1 = require("@scrabble-solver/word-lists");
const downloadDictionary = async (locale) => {
logger_1.logger.info('downloadDictionary', { locale });
const words = await (0, word_lists_1.getWordList)(locale);
logger_1.logger.info('downloadDictionary - success', { locale });
const trie = trie_1.Trie.fromArray(words);
return trie;
};
exports.downloadDictionary = downloadDictionary;