Package joshua.corpus.alignment

Examples of joshua.corpus.alignment.AlignmentGrids.writeExternal()


      {
        String binaryAlignmentsFilename = outputDirName + File.separator + "alignment.grids";
        if (logger.isLoggable(Level.INFO)) logger.info("Writing binary alignment grids to disk at " + binaryAlignmentsFilename);

        BinaryOut alignmentsOut = new BinaryOut(binaryAlignmentsFilename);
        grids.writeExternal(alignmentsOut);
        alignmentsOut.flush();
        alignmentsOut.close();

        out.println("Source-target alignment grids: " + binaryAlignmentsFilename);
      }
View Full Code Here


    } else if (alignmentsType.equals("MemoryMappedAlignmentGrids")) {
      AlignmentGrids grids = new AlignmentGrids(new Scanner(new File(alignmentFileName)), sourceCorpusArray, targetCorpusArray, 3);
     
      File mmAlignmentFile = File.createTempFile("memoryMappedAlignment", new Date().toString());
      ObjectOutput out = new BinaryOut(mmAlignmentFile);
      grids.writeExternal(out);
      out.flush();
      out.close();
     
      alignments = new MemoryMappedAlignmentGrids(mmAlignmentFile.getAbsolutePath(), sourceCorpusArray, targetCorpusArray);
    } else {
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.