insert(pos, length, score, tokenId) {
        const nodeId = this.nodes.length;
        const node = new TokenLatticeNode(tokenId, nodeId, pos, length, score);
        this.beginNodes[pos].push(node);
        this.endNodes[pos + length].push(node);
        this.nodes.push(node);
    }
Inserts a new token node into the token lattice.

@param {number} pos The starting position of the token.
@param {number} length The length of the token.
@param {number} score The score of the token.
@param {number} tokenId The token ID of the token.