"use strict";
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;
