for (Iterator ki=wordMap.iterator();ki.hasNext();) {
String key = (String) ki.next();
output.writeUTF(key);
output.writeInt(wordMap.getIndex(key));
}
CountedSet cset = (CountedSet) gramSet;
int gramCount = 0;
for (Iterator gi = gramSet.iterator();gi.hasNext();) {
NGram ngram = (NGram) gi.next();
if (cset.getCount(ngram) >= cutoff) {
int[] words = ngram.getWords();
output.writeInt(words.length);
for (int wi=0;wi<words.length;wi++) {
output.writeInt(words[wi]);
}