{
ArrayList<KeyString> idflist=new ArrayList<KeyString>();
System.out.println("Saving "+file.getName());
WritableWorkbook workbook = Workbook.createWorkbook(file);
WritableSheet header = workbook.createSheet("Experimental setup", 0);
addHeader(header,tests);
if(summary.contains("all")||summary.contains("performance"))
{
System.out.println("Generating performance summary sheet");
WritableSheet sheet = workbook.createSheet("Performance summary", workbook.getNumberOfSheets());
addPerformanceSheet(sheet,tests,time);
}
if(summary.contains("all")||summary.contains("disambiguation"))
{
System.out.println("Generating disambiguation summary sheet");
WritableSheet sheet = workbook.createSheet("Words leading to disambiguation", workbook.getNumberOfSheets());
addDisambiguationSheet(sheet,tests);
}
if(summary.contains("all")||summary.contains("words"))
{
System.out.println("Problem summary sheet");
WritableSheet docs = workbook.createSheet("Disambiguated words", workbook.getNumberOfSheets());
addProblemSheet(docs,tests);
}
if(summary.contains("all")||summary.contains("overlap"))
{
System.out.println("Generating overlap summary sheet");
WritableSheet sheet = workbook.createSheet("Overlap by IDF summary", workbook.getNumberOfSheets());
if(idflist.size()==0)
XLSWriter.retrieveIDFs(idflist, tests);
addOverlapSheet(sheet, tests,idflist);
}
if(summary.contains("all")||summary.contains("sense"))
{
System.out.println("Generating sense stats sheet");
WritableSheet sheet = workbook.createSheet("Algorithm behavior", workbook.getNumberOfSheets());
addMiscSheet(sheet, tests);
}
if(detail.contains("all")||detail.contains("performance"))
{
System.out.println("Generating performance detail sheet");
WritableSheet sheet = workbook.createSheet("Performance detail", workbook.getNumberOfSheets());
addPerformanceDetailSheet(sheet,tests);
}
if(detail.contains("all")||detail.contains("disambiguation"))
{
System.out.println("Generating disambiguation detail sheet");
WritableSheet sheet = workbook.createSheet("Disambiguation detail", workbook.getNumberOfSheets());
if(idflist.size()==0)
XLSWriter.retrieveIDFs(idflist, tests);
addDisambiguationDetailSheet(sheet,tests,idflist);
}
if(detail.contains("all")||detail.contains("words"))
{
System.out.println("Generating problem detail sheet");
WritableSheet docs = workbook.createSheet("Problem detail", workbook.getNumberOfSheets());
if(idflist.size()==0)
XLSWriter.retrieveIDFs(idflist, tests);
addProblemDetailSheet(docs,tests,idflist);
}
if(detail.contains("overlap"))
{
System.out.println("Generating overlap detail sheet");
WritableSheet sheet = workbook.createSheet("Overlap detail", workbook.getNumberOfSheets());
addOverlapDetailSheet(sheet,tests);
}
if(detail.contains("all")||detail.contains("sense"))
{
System.out.println("Generating sense detail sheet");
WritableSheet sheet = workbook.createSheet("Disambiguation by sense number", workbook.getNumberOfSheets());
addSenseSheet(sheet,tests);
}
workbook.write();
workbook.close();
System.out.println(file.getName()+" saved");