Package org.terrier.structures

Examples of org.terrier.structures.InvertedIndexInputStream


      do//for each pass of the inverted file
      {
        iteration++;
        //logger.info("Iteration "+iteration  + iterationSuffix);
        //get a copy of the inverted index
        final InvertedIndexInputStream iiis = (InvertedIndexInputStream) index.getIndexStructureInputStream(sourceStructure);
        //work out how many document we can scan for
        lastDocid = firstDocid + scanDocumentIndexForTokens(processTokens, diis);
        //logger.info("Generating postings for documents with ids "+firstDocid + " to " + lastDocid);
        //get a set of posting objects to save the compressed postings for each of the documents to
        final Posting[] postings = getPostings(lastDocid - firstDocid +1 );
View Full Code Here


      {
        logger.error("No such index : "+ Index.getLastIndexLoadError());       
      }
      if (i.hasIndexStructureInputStream("inverted"))
      {
        InvertedIndexInputStream invIndex = (InvertedIndexInputStream)(i.getIndexStructureInputStream("inverted"));
        invIndex.print();
        invIndex.close();
      }
      else
      {
        //logger.warn("Sorry, no inverted index inputstream structure in index");
      }
View Full Code Here

 
  public void checkInvertedIndexStream(Index index, int[] documentLengths) throws Exception
  {
    final int numDocs = index.getCollectionStatistics().getNumberOfDocuments();
    TIntIntHashMap calculatedDocLengths = new TIntIntHashMap();
    InvertedIndexInputStream iiis = (InvertedIndexInputStream) index.getIndexStructureInputStream("inverted");
    assertNotNull(iiis);
    int ithTerm = -1;
    while(iiis.hasNext())
    {
      ithTerm++;
      final IterablePosting ip = iiis.getNextPostings();
      int count = 0;
      final int expected = iiis.getNumberOfCurrentPostings();
      while(ip.next() != IterablePosting.EOL)
      {
        //System.err.println("Got id " + ip.getId());
        assertTrue("Got too big a docid ("+ip.getId()+") from inverted index input stream for term at index " + ithTerm, ip.getId() < numDocs);
        count++;
View Full Code Here

TOP

Related Classes of org.terrier.structures.InvertedIndexInputStream

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.