private void writeObject(ObjectOutputStream out) throws IOException { out.writeInt(CURRENT_SERIAL_VERSION); out.writeObject(prefix); out.writeInt(gramSizes.length); for (int i = 0; i < gramSizes.length; i++) out.writeInt(gramSizes[i]); out.writeBoolean(distinguishBorders); }
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); }
public void write(File f) { try { ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(f)); oos.writeObject(this); oos.close(); } catch (IOException e) { System.err.println("Exception writing file " + f + ": " + e); } }
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]); }
private void writeObject(ObjectOutputStream out) throws IOException { out.writeInt(CURRENT_SERIAL_VERSION); out.writeObject(prefix); }