Package org.terrier.structures.postings

Examples of org.terrier.structures.postings.BasicPostingImpl


 
  @SuppressWarnings("unchecked")
  @Test public void testSingleEntrySinglePostingSingleFile() throws Exception
  {
    List<Posting> postings = new ArrayList<Posting>();
    postings.add(new BasicPostingImpl(1,1));
    List<BitIndexPointer> pointerList = new ArrayList<BitIndexPointer>();
    String filename = PostingTestUtils.writePostingsToFile(new Iterator[]{postings.iterator()}, pointerList);
    BitPostingIndex structure = new BitPostingIndex(filename, (byte) 1, BasicIterablePosting.class, "file", 0);
    PostingTestUtils.comparePostings(postings, structure.getPostings(pointerList.get(0)));
  }
View Full Code Here


 
  @SuppressWarnings("unchecked")
  @Test public void testSingleEntryMultiplePostingsSingleFile() throws Exception
  {
    List<Posting> postings = new ArrayList<Posting>();
    postings.add(new BasicPostingImpl(1,1));
    postings.add(new BasicPostingImpl(2,2));
    postings.add(new BasicPostingImpl(1000,1000));
    postings.add(new BasicPostingImpl((int)5e6,(int)5e6));
    List<BitIndexPointer> pointerList = new ArrayList<BitIndexPointer>();
    String filename = PostingTestUtils.writePostingsToFile(new Iterator[]{postings.iterator()}, pointerList);
    BitPostingIndex structure = new BitPostingIndex(filename, (byte) 1, BasicIterablePosting.class, "file", 0);
    PostingTestUtils.comparePostings(postings, structure.getPostings(pointerList.get(0)));
  }
View Full Code Here

 
  @SuppressWarnings("unchecked")
  @Test public void testMultipleEntryMultiplePostingSingleFile() throws Exception
  {
    List<Posting> postings1 = new ArrayList<Posting>();
    postings1.add(new BasicPostingImpl(1,1));
    postings1.add(new BasicPostingImpl(2,2));
    postings1.add(new BasicPostingImpl(1000,1000));
   
    List<Posting> postings2 = new ArrayList<Posting>();
    postings2.add(new BasicPostingImpl(1,4));
    postings2.add(new BasicPostingImpl(2,4));
    postings2.add(new BasicPostingImpl(1000,4));
   
    List<BitIndexPointer> pointerList = new ArrayList<BitIndexPointer>();
    String filename = PostingTestUtils.writePostingsToFile(new Iterator[]{postings1.iterator(), postings2.iterator()}, pointerList);
    BitPostingIndex structure = new BitPostingIndex(filename, (byte) 1, BasicIterablePosting.class, "file", 0);
    PostingTestUtils.comparePostings(postings1, structure.getPostings(pointerList.get(0)));
View Full Code Here

 
  @SuppressWarnings("unchecked")
  @Test public void testMultipleEntrySinglePostingSingleFile() throws Exception
  {
    List<Posting> postings1 = new ArrayList<Posting>();
    postings1.add(new BasicPostingImpl(2,2));
   
    List<Posting> postings2 = new ArrayList<Posting>();
    postings2.add(new BasicPostingImpl(1000,4));
   
    List<BitIndexPointer> pointerList = new ArrayList<BitIndexPointer>();
    String filename = PostingTestUtils.writePostingsToFile(new Iterator[]{postings1.iterator(), postings2.iterator()}, pointerList);
    BitPostingIndex structure = new BitPostingIndex(filename, (byte) 1, BasicIterablePosting.class, "file", 0);
    PostingTestUtils.comparePostings(postings1, structure.getPostings(pointerList.get(0)));
View Full Code Here

TOP

Related Classes of org.terrier.structures.postings.BasicPostingImpl

Copyright © 2018 www.massapicom. 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.