if (!m_FirstBatchDone) {
if (!isFirstBatchDone()) {
  public boolean batchFinished() throws Exception {    if (getInputFormat() == null) {      throw new IllegalStateException("No input instance format defined");    }    // We only need to do something in this method    // if the first batch hasn't been processed. Otherwise    // input() has already done all the work.    if (!m_FirstBatchDone) {      // Determine the dictionary from the first batch (training data)      determineDictionary();      // Convert all instances w/o normalization      FastVector fv = new FastVector();      int firstCopy=0;      for(int i=0; i < numInstances; i++) {	firstCopy = convertInstancewoDocNorm(getInputFormat().instance(i), fv);      }            // Need to compute average document length if necessary      if (m_filterType != FILTER_NONE) {	avgDocLength = 0;	for(int i=0; i<fv.size(); i++) {	  Instance inst = (Instance) fv.elementAt(i);	  double docLength = 0;	  for(int j=0; j<inst.numValues(); j++) {	    if(inst.index(j)>=firstCopy) {	      docLength += inst.valueSparse(j) * inst.valueSparse(j);	    }	  }        	  avgDocLength += Math.sqrt(docLength);	}	avgDocLength /= numInstances;      }      // Perform normalization if necessary.      if (m_filterType == FILTER_NORMALIZE_ALL) {	for(int i=0; i<fv.size(); i++) {	  normalizeInstance((Instance) fv.elementAt(i), firstCopy);	}      }      // Push all instances into the output queue      for(int i=0; i<fv.size(); i++) {	push((Instance) fv.elementAt(i));      }    }    // Flush the input    flushInput();    m_NewBatch = true;    m_FirstBatchDone = true;    return (numPendingOutput() != 0);  }