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.
13 lines (11 loc) • 491 B
text/typescript
import { Trie } from '@kamilmielnik/trie';
import { logger } from '@scrabble-solver/logger';
import { type Locale } from '@scrabble-solver/types';
import { getWordList } from '@scrabble-solver/word-lists';
export const downloadDictionary = async (locale: Locale): Promise<Trie> => {
logger.info('downloadDictionary', { locale });
const words = await getWordList(locale);
logger.info('downloadDictionary - success', { locale });
const trie = Trie.fromArray(words);
return trie;
};