code: public static final void parseSentence(final int[] sent, final CnfGrammar grammar, final LoopOrder loopOrder, final Chart chart, final Scorer scorer) {
          // Apply lexical rules to each word.
          for (int i = 0; i <= sent.length - 1; i++) {
              ChartCell cell = chart.getCell(i, i+1);
              for (final Rule r : grammar.getLexicalRulesWithChild(sent[i])) {
                  double score = scorer.score(r, i, i+1, i+1);
                  cell.updateCell(r.getParent(), score, i+1, r);
              }
          }
          
          // For each cell in the chart. (width increasing)
          for (int width = 1; width <= sent.length; width++) {
              for (int start = 0; start <= sent.length - width; start++) {
                  int end = start + width;
                  ChartCell cell = chart.getCell(start, end);
                  
                  // Apply binary rules.
                  if (loopOrder == LoopOrder.CARTESIAN_PRODUCT) {
                      processCellCartesianProduct(grammar, chart, start, end, cell, scorer);
                  } else if (loopOrder == LoopOrder.LEFT_CHILD) {
                      processCellLeftChild(grammar, chart, start, end, cell, scorer);
                  } else if (loopOrder == LoopOrder.RIGHT_CHILD) {
                      processCellRightChild(grammar, chart, start, end, cell, scorer);
                  } else {
                      throw new RuntimeException("Not implemented: " + loopOrder);
                  }
                  
                  processCellUnaryRules(grammar, start, end, cell, scorer);
                  if (width == sent.length) {
                      processCellUnaryRules(grammar, start, end, cell, scorer);
                  }
                  
                  cell.close();
              }
          }
      
      }
docs: Runs CKY and populates the chart.
  
  @param sent The input sentence.
  @param grammar The input grammar.
  @param loopOrder The loop order to use when parsing.
  @param chart The output chart.