private int[][] readIntArray2(ObjectInputStream in) throws IOException {
   int d1 = in.readInt();
   int d2 = in.readInt();
   int[][] a = new int[d1][d2];
   for (int i = 0; i < d1; i++) for (int j = 0; j < d2; j++) a[i][j] = in.readInt();
   return a;
 }
  private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
    int version = in.readInt();
    prefix = (String) in.readObject();
    int gsl = in.readInt();
    if (gsl > 0) {
      gramSizes = new int[gsl];
      for (int i = 0; i < gsl; i++) gramSizes[i] = in.readInt();
    }

    if (version >= 1) {
      distinguishBorders = in.readBoolean();
    }
  }
Exemple #3
0
 private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
   int featuresLength;
   int version = in.readInt();
   ilist = (InstanceList) in.readObject();
   numTopics = in.readInt();
   alpha = in.readDouble();
   beta = in.readDouble();
   tAlpha = in.readDouble();
   vBeta = in.readDouble();
   int numDocs = ilist.size();
   topics = new int[numDocs][];
   for (int di = 0; di < ilist.size(); di++) {
     int docLen = ((FeatureSequence) ilist.get(di).getData()).getLength();
     topics[di] = new int[docLen];
     for (int si = 0; si < docLen; si++) topics[di][si] = in.readInt();
   }
   docTopicCounts = new int[numDocs][numTopics];
   for (int di = 0; di < ilist.size(); di++)
     for (int ti = 0; ti < numTopics; ti++) docTopicCounts[di][ti] = in.readInt();
   int numTypes = ilist.getDataAlphabet().size();
   typeTopicCounts = new int[numTypes][numTopics];
   for (int fi = 0; fi < numTypes; fi++)
     for (int ti = 0; ti < numTopics; ti++) typeTopicCounts[fi][ti] = in.readInt();
   tokensPerTopic = new int[numTopics];
   for (int ti = 0; ti < numTopics; ti++) tokensPerTopic[ti] = in.readInt();
 }
 private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
   int version = in.readInt();
   prefix = (String) in.readObject();
 }