/** * Reads language model order and ngram counts * @return array of counts where ordinal number is ngram order * @throws IOException if reading from stream failed */ public int[] readCounts() throws IOException { int order = readOrder(); int[] counts = new int[order]; for (int i = 0; i < counts.length; i++) { counts[i] = Utilities.readLittleEndianInt(inStream); } return counts; }
/** * Reads language model order and ngram counts * @return array of counts where ordinal number is ngram order * @throws IOException if reading from stream failed */ public int[] readCounts() throws IOException { int order = readOrder(); int[] counts = new int[order]; for (int i = 0; i < counts.length; i++) { counts[i] = Utilities.readLittleEndianInt(inStream); } return counts; }