if (ngrams.size() == 0)
return;
for (Map.Entry<QNameTerm, OccurrenceList> entry : ngrams.entrySet()) {
QNameTerm key = entry.getKey();
OccurrenceList occurences = entry.getValue();
occurences.sort();
os.clear();
os.writeInt(currentDoc.getDocId());
os.writeByte(key.qname.getNameType());
os.writeInt(occurences.getTermCount());
//Mark position