Package joshua.corpus.vocab

Examples of joshua.corpus.vocab.Vocabulary.writeExternal()


//    vocab.fixVocabulary();
   
   
    // Write the vocabulary to disk in binary format
    ObjectOutput out = new BinaryOut(outVocabFile);
    vocab.writeExternal(out);
   
  }
 
}
View Full Code Here


    try {
     
      File tempFile = File.createTempFile(BinaryTest.class.getName(), "vocab");
      FileOutputStream outputStream = new FileOutputStream(tempFile);
      ObjectOutput out = new BinaryOut(outputStream, true);
      vocab.writeExternal(out);
     
      ObjectInput in = new BinaryIn<Vocabulary>(tempFile.getAbsolutePath(), Vocabulary.class);
      Object o = in.readObject();
      Assert.assertTrue(o instanceof Vocabulary);
     
View Full Code Here

      if (logger.isLoggable(Level.INFO)) logger.info("Writing binary common vocabulary to disk at " + binaryVocabFilename);
     
      ObjectOutput vocabOut =
          new BinaryOut(new FileOutputStream(binaryVocabFilename), true);
      symbolTable.setExternalizableEncoding(charset);
        symbolTable.writeExternal(vocabOut);
        vocabOut.flush();
       
      out.println("Common symbol table for source and target language: " + binaryVocabFilename);
    }
   
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.