docs: private void accumulateSufficientStatistics(CfgParseTree tree,
        SufficientStatistics nonterminalStatistics, SufficientStatistics terminalStatistics,
        SufficientStatistics nonterminalParameters, SufficientStatistics terminalParameters,
        double weight) {
      if (tree == CfgParseTree.EMPTY) {
        return;
      }
  
      if (tree.isTerminal()) {
        Assignment terminalRule = parentVar.outcomeArrayToAssignment(tree.getRoot())
            .union(terminalVar.outcomeArrayToAssignment(tree.getTerminalProductions()))
            .union(ruleTypeVar.outcomeArrayToAssignment(tree.getRuleType()));
        terminalFactor.incrementSufficientStatisticsFromAssignment(terminalStatistics,
            terminalParameters, terminalRule, weight);
        // System.out.println(weight + " " + terminalRule);
      } else {
        Assignment nonterminalRule = parentVar.outcomeArrayToAssignment(tree.getRoot())
            .union(leftVar.outcomeArrayToAssignment(tree.getLeft().getRoot()))
            .union(rightVar.outcomeArrayToAssignment(tree.getRight().getRoot()))
            .union(ruleTypeVar.outcomeArrayToAssignment(tree.getRuleType()));
        nonterminalFactor.incrementSufficientStatisticsFromAssignment(nonterminalStatistics,
            terminalParameters, nonterminalRule, weight);
        // System.out.println(weight + " " + nonterminalRule);
        accumulateSufficientStatistics(tree.getLeft(), nonterminalStatistics,
            terminalStatistics, nonterminalParameters, terminalParameters, weight);
        accumulateSufficientStatistics(tree.getRight(), nonterminalStatistics,
            terminalStatistics, nonterminalParameters, terminalParameters, weight);
      }
    }