public void reset(Sentence sentence) {
        this.sentence = sentence;
        // Ensure that the chart is large enough.
        if (sentence.size() > chart.length){
            chart = getNewChart(sentence, grammar, cellType, parseType, constraint);
        } else {
            // Clear the chart.
            //
            // Note that we only need to clear the portion that will be used while parsing this sentence.
            for (int i = 0; i < sentence.size(); i++) {
                for (int j = i+1; j < sentence.size() + 1; j++) {
                    chart[i][j].reset(sentence);
                }
            }
        }
    }
public void reset ( Sentence sentence ) { this . sentence = sentence ; if ( sentence . size ( ) > chart . length ) { chart = getNewChart ( sentence , grammar , cellType , parseType , constraint ) ; } else { for ( int i = 0 ; i < sentence . size ( ) ; i ++ ) { for ( int j = i + 1 ; j < sentence . size ( ) + 1 ; j ++ ) { chart [ i ] [ j ] . reset ( sentence ) ; } } } }
Resets the chart for the input sentence.