/** * Begins the multiway merging phase. * @param size number of runs to be merged. * @param fileName output filename. * @throws Exception if an I/O error occurs. */ public void beginMerge(int size, String fileName) throws Exception{ init(size, fileName); myRun = queue.poll(); while(myRun.current().getTerm().equals(" ")) myRun = queue.poll(); lastDocument = myRun.current().append(bos,-1); termStatistics = myRun.current().getLexiconEntry(); lastFreq = myRun.current().getTF(); lastDocFreq = myRun.current().getDf(); lastTermWritten = myRun.current().getTerm(); if(myRun.hasNext()){ myRun.next(); queue.add(myRun); }else{ myRun.close(); } }
if(myRun.hasNext()){ myRun.next(); queue.add(myRun);