public class NbestMerger {
public static int mergeNbest(String nbestFile1, String nbestFile2, String nbestOutFile){
int totalNumHyp = 0;
try {
NbestReader nbestReader1 = new NbestReader(nbestFile1);
NbestReader nbestReader2 = new NbestReader(nbestFile2);
BufferedWriter outWriter = FileUtility.getWriteFileStream(nbestOutFile);
while(nbestReader1.hasNext()){
List<String> nbest1 = nbestReader1.next();
List<String> nbest2 = nbestReader2.next();
List<String> newNbest = processOneSentence(nbest1, nbest2);
for(String hyp : newNbest){
outWriter.write(hyp+"\n");
}