code: public void updateBinaryRuleExpectations(double[] binaryRuleMarginal) {
      for (int i = 0; i < binaryRuleExpectations.length; i++) {
        binaryRuleExpectations[i] += binaryRuleMarginal[i];
      }
    }
docs: Update the expected number of times that a binary production rule is used
  in a parse. (This method assumes sum-product)