docs: public List<CcgParse> decodeBestParsesForSpan(int spanStart, int spanEnd, int numParses,
        CcgParser parser) {
      // Perform a heap sort on the array indexes paired with the
      // probabilities.
      double[] probsCopy = ArrayUtils.copyOf(probabilities[spanStart][spanEnd], probabilities[spanStart][spanEnd].length);
      Integer[] chartEntryIndexes = new Integer[probabilities[spanStart][spanEnd].length];
      for (int i = 0; i < chartEntryIndexes.length; i++) {
        chartEntryIndexes[i] = i;
      }
  
      // Heaps are min-heaps, so we throw away the initial entries.
      // Then the remaining entries are the best parses.
      List<CcgParse> bestParses = Lists.newArrayList();
      int numChartEntries = getNumChartEntriesForSpan(spanStart, spanEnd);
      while (numChartEntries > 0) {
        if (numChartEntries <= numParses) {
          bestParses.add(decodeParseFromSpan(spanStart, spanEnd, chartEntryIndexes[0], parser));
        }
  
        HeapUtils.removeMin(chartEntryIndexes, probsCopy, numChartEntries);
        numChartEntries--;
      }
  
      Collections.reverse(bestParses);
      return bestParses;
    }