示例#1
0
 private void writeObject(ObjectOutputStream out) throws IOException {
   out.writeInt(CURRENT_SERIAL_VERSION);
   out.writeObject(ilist);
   out.writeInt(numTopics);
   out.writeDouble(alpha);
   out.writeDouble(beta);
   out.writeDouble(tAlpha);
   out.writeDouble(vBeta);
   for (int di = 0; di < topics.length; di++)
     for (int si = 0; si < topics[di].length; si++) out.writeInt(topics[di][si]);
   for (int di = 0; di < topics.length; di++)
     for (int ti = 0; ti < numTopics; ti++) out.writeInt(docTopicCounts[di][ti]);
   for (int fi = 0; fi < numTypes; fi++)
     for (int ti = 0; ti < numTopics; ti++) out.writeInt(typeTopicCounts[fi][ti]);
   for (int ti = 0; ti < numTopics; ti++) out.writeInt(tokensPerTopic[ti]);
 }
 /** Format: mapType, num, (key, value) pairs */
 private void writeObject(ObjectOutputStream out) throws IOException {
   out.writeObject(mapType);
   out.writeInt(num);
   for (Entry e : this) {
     out.writeObject(e.getKey());
     out.writeDouble(e.getValue());
   }
 }
示例#3
0
 private void writeObject(ObjectOutputStream out) throws IOException {
   out.writeInt(CURRENT_SERIAL_VERSION);
   int size = data.length;
   out.writeInt(size);
   for (int i = 1; i < size; i++) {
     out.writeDouble(data[i]);
   }
   out.writeInt(this.size);
 }
示例#4
0
 private void writeObject(ObjectOutputStream out) throws IOException {
   out.writeInt(CURRENT_SERIAL_VERSION);
   out.writeObject(ilist);
   out.writeInt(numTopics);
   out.writeDouble(alpha);
   out.writeDouble(beta);
   out.writeDouble(gamma);
   out.writeDouble(delta);
   out.writeDouble(tAlpha);
   out.writeDouble(vBeta);
   out.writeDouble(vGamma);
   out.writeInt(numTypes);
   out.writeInt(numBitypes);
   out.writeInt(numTokens);
   out.writeInt(biTokens);
   for (int di = 0; di < topics.length; di++)
     for (int si = 0; si < topics[di].length; si++) out.writeInt(topics[di][si]);
   for (int di = 0; di < topics.length; di++)
     for (int si = 0; si < topics[di].length; si++) out.writeInt(grams[di][si]);
   writeIntArray2(docTopicCounts, out);
   for (int fi = 0; fi < numTypes; fi++)
     for (int n = 0; n < 2; n++)
       for (int ti = 0; ti < numTopics; ti++) out.writeInt(typeNgramTopicCounts[fi][n][ti]);
   writeIntArray2(unitypeTopicCounts, out);
   writeIntArray2(bitypeTopicCounts, out);
   for (int ti = 0; ti < numTopics; ti++) out.writeInt(tokensPerTopic[ti]);
   writeIntArray2(bitokensPerTopic, out);
 }