TokenList tl = tcache.getTokenList(doc);
if (tl == null){
tl = TokenizationService.getTokenizationService().tokenize(doc);
tcache.putTokenList(doc, tl);
}
WordFrequencyMap map = new WordFrequencyMap(tl);
row = sheet.createRow((short)rowNumber);
cell = row.createCell((short)0);
cell.setEncoding(HSSFCell.ENCODING_UTF_16);
cell.setCellValue(doc.getTitle());
for (int ii = 0; ii < vocab.size(); ii++) {
cell = row.createCell((short)(ii+1));
Integer count = map.getWordCount(vocab.get(ii));
if (count == null)
cell.setCellValue((double)0);
else
cell.setCellValue((double)count.doubleValue());
}
cell = row.createCell((short)(vocab.size()+1));
cell.setCellValue((double)map.getTotal());
rowNumber++;
}
wb.write(stream);
// something else should close the file