code: protected void loadGrams(DataInputStream input) throws IOException {
      gramSet = new HashSet();
      try {
        while(true) {
          int gramLength=input.readInt();
        
          int[] words = new int[gramLength];
          for (int wi=0;wi<gramLength;wi++) {
            words[wi]=input.readInt();
          }
          gramSet.add(new NGram(words));
        }
      }
      catch(EOFException e) {
        
      }
    }
docs: Loads the contents of the specified input stream into this dictionary.
  @param input A dictionary file.
  @throws IOException If the specified input stream can not be read.