Package org.terrier.compression

Examples of org.terrier.compression.MemorySBOS.pad()


   */
  @Override
  public void writeTerm(final String term, final Posting post) throws IOException
 
    final MemorySBOS Docs = post.getDocs();
    Docs.pad();
    //get the posting array buffer
    byte[] buffer = new byte[Docs.getMOS().getPos()+1];
    System.arraycopy(Docs.getMOS().getBuffer(), 0,
        buffer, 0,
        Math.min(Docs.getMOS().getBuffer().length, Docs.getMOS().getPos()+1));
View Full Code Here


            //some obscure problem when reading from memory rather than disk.
            //by padding the posting list with some non zero bytes the problem
            //is solved. Thanks to Roicho for working this one out.
            Docs.writeGamma(1);
            Docs.writeGamma(1);
            Docs.pad();
         
            //use a PostingInRun to decompress the postings stored in memory
            final PostingInRun pir = getPostingReader();
            pir.setDf(p.getDocF());
            pir.setTF(p.getTF());
View Full Code Here

    stringDos.writeUTF(term);
    bos.writeGamma(post.getDocF());
    bos.writeGamma(post.getTF());
    //System.err.println("Writing "+term + " TF="+post.getTF()+ " Nt="+post.getDocF());
    final MemorySBOS Docs = post.getDocs();
    Docs.pad();
    /* when reading, ie RunReader and it's children classes
     * an align call is required here. */
    bos.append(Docs.getMOS().getBuffer(), Docs.getMOS().getPos());
  }
   
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.