code: public static SimpleDocument parse(String line) {
  		String[] splits = line.split("\t");
  		if (splits.length < 4)
  			return null;
  		// ignore first part
  		SimpleDocument newdoc = new SimpleDocument();
  		try {
  			newdoc.label = Integer.parseInt(splits[1]);
  			newdoc.totalNumberTokens = Double.parseDouble(splits[2]);
  			// num features
  			int numfeatures = splits.length - 3;
  			newdoc.freqs = new int[numfeatures];
  			newdoc.indices = new int[numfeatures];
  			int lastPos = 0;
  			for (int f = 3; f < splits.length; f++) {
  				// x:y
  				int sep = splits[f].indexOf(":");
  				String pos = splits[f].substring(0, sep);
  				String val = splits[f].substring(sep + 1);
  				newdoc.indices[lastPos] = Integer.parseInt(pos);
  				newdoc.freqs[lastPos] = Integer.parseInt(val);
  				lastPos++;
  			}
  		} catch (Exception e) {
  			return null;
  		}
  		return newdoc;
  	}
docs: Build a document from a serialized string *