Package org.terrier.structures.postings
Class ArrayOfBasicIterablePosting
- java.lang.Object
-
- org.terrier.structures.postings.IterablePostingImpl
-
- org.terrier.structures.postings.ArrayOfIdsIterablePosting
-
- org.terrier.structures.postings.ArrayOfBasicIterablePosting
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,java.lang.Cloneable,IterablePosting,Posting
- Direct Known Subclasses:
ArrayOfBlockIterablePosting,ArrayOfFieldIterablePosting
public class ArrayOfBasicIterablePosting extends ArrayOfIdsIterablePosting
An instance of IterablePostings that works with passed arrays of ids and frequencies- Author:
- Craig Macdonald
-
-
Field Summary
Fields Modifier and Type Field Description protected int[]doclensprotected int[]frequenciesfrequencies of all of the stored postings-
Fields inherited from class org.terrier.structures.postings.ArrayOfIdsIterablePosting
id, ids, indice
-
Fields inherited from interface org.terrier.structures.postings.IterablePosting
END_OF_LIST, EOL
-
-
Constructor Summary
Constructors Constructor Description ArrayOfBasicIterablePosting(int[] _ids, int[] _freqs)Make a new posting list with these ids and frequenciesArrayOfBasicIterablePosting(int[] _ids, int[] _freqs, int[] _lens)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetDocumentLength()Return the length of the document of the current posting in tokens.intgetFrequency()Return the frequency of the term in the current document, in tokens.-
Methods inherited from class org.terrier.structures.postings.ArrayOfIdsIterablePosting
asWritablePosting, clone, close, endOfPostings, getId, next, reset
-
Methods inherited from class org.terrier.structures.postings.IterablePostingImpl
next
-
-
-
-
Method Detail
-
getFrequency
public int getFrequency()
Return the frequency of the term in the current document, in tokens.- Specified by:
getFrequencyin interfacePosting- Overrides:
getFrequencyin classArrayOfIdsIterablePosting- Returns:
- frequency of the term in the current document, in tokens.
-
getDocumentLength
public int getDocumentLength()
Description copied from class:ArrayOfIdsIterablePostingReturn the length of the document of the current posting in tokens. Usually uses the DocumentIndex, may do otherwise if document length statistics are in posting list. Returns 0.- Specified by:
getDocumentLengthin interfacePosting- Overrides:
getDocumentLengthin classArrayOfIdsIterablePosting- Returns:
- length of the document of the current posting in tokens.
-
-