_buildTrie(dictionary) {
        const trie = Object.create(null);
        for (const word of dictionary) {
            let node = trie;
            for (let i = 0; i < word.length; ++i) {
                node = (node[word[i]] ??= Object.create(null));
            }
            node.end = word;
        }
        return trie;
    }
Builds a trie from the given dictionary.
@param {string[]} dictionary The dictionary of words to build the trie from.
@returns {Object} The root node of the trie.
@private