How to use the cspell-trie-lib.Trie.create function in cspell-trie-lib

To help you get started, we’ve selected a few cspell-trie-lib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github streetsidesoftware / cspell / packages / cspell-lib / src / SpellingDictionary / SpellingDictionary.ts View on Github external
{ w: lc, p: true },
                { w: lc_na, p: true },
            ];
        };
    const words = genSequence(wordList)
        .filter(word => typeof word === 'string')
        .map(word => word.trim())
        .filter(w => !!w)
        .concatMap(mapCase)
        .reduce((s, w) => {
            if (!s.has(w.w)) {
                s.add(w.p ? PREFIX_NO_CASE + w.w : w.w);
            }
            return s;
        }, new Set());
    const trie = Trie.create(words);
    return new SpellingDictionaryFromTrie(trie, name, options, source, words.size);
}