Package org.terrier.structures.postings
Class PostingUtil
- java.lang.Object
-
- org.terrier.structures.postings.PostingUtil
-
public class PostingUtil extends java.lang.Object
Handy methods for Posting classes, such as obtaining all ids in a posting list, or selecting the minimum id in an array of posting lists.- Since:
- 3.0
- Author:
- Craig Macdonald
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PostingUtil.DocidSpecificDocumentIndex
-
Constructor Summary
Constructors Constructor Description PostingUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int[][]
getAllPostings(IterablePosting ip)
Get an array of all the ids in a given IterablePosting stream, where the length of the stream is knownstatic int[][]
getAllPostings(IterablePosting ip, int numPointers)
Get an array of all the ids and frequencies in a given IterablePosting stream, where the length of the stream is unknownstatic int[][]
getAllPostingsWithFields(IterablePosting ip, int numPointers, int fieldCount)
Get an array of all the ids in a given IterablePosting stream, where the length of the stream is knownstatic int[]
getIds(IterablePosting ip)
Get an array of all the ids in a given IterablePosting streamstatic int[]
getIds(IterablePosting ip, int numPointers)
Get an array of all the ids in a given IterablePosting stream, where the length of the stream is knownstatic int
selectMinimumDocId(IterablePosting[] postingListArray)
Returns the minimum docid of the current postings in the array of IterablePostings
-
-
-
Method Detail
-
getIds
public static int[] getIds(IterablePosting ip) throws java.io.IOException
Get an array of all the ids in a given IterablePosting stream- Throws:
java.io.IOException
-
getIds
public static int[] getIds(IterablePosting ip, int numPointers) throws java.io.IOException
Get an array of all the ids in a given IterablePosting stream, where the length of the stream is known- Throws:
java.io.IOException
-
getAllPostings
public static int[][] getAllPostings(IterablePosting ip, int numPointers) throws java.io.IOException
Get an array of all the ids and frequencies in a given IterablePosting stream, where the length of the stream is unknown- Throws:
java.io.IOException
-
getAllPostingsWithFields
public static int[][] getAllPostingsWithFields(IterablePosting ip, int numPointers, int fieldCount) throws java.io.IOException
Get an array of all the ids in a given IterablePosting stream, where the length of the stream is known- Throws:
java.io.IOException
-
getAllPostings
public static int[][] getAllPostings(IterablePosting ip) throws java.io.IOException
Get an array of all the ids in a given IterablePosting stream, where the length of the stream is known- Throws:
java.io.IOException
-
selectMinimumDocId
public static int selectMinimumDocId(IterablePosting[] postingListArray)
Returns the minimum docid of the current postings in the array of IterablePostings- Returns:
- minimum docid, or -1 if all postings have ended.
-
-