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:
- Closeable, IterablePosting, Posting
- Direct Known Subclasses:
- ArrayOfFieldIterablePosting
public class ArrayOfBasicIterablePosting
- extends ArrayOfIdsIterablePosting
An instance of IterablePostings that works with passed arrays of ids and frequencies
- Author:
- Craig Macdonald
Field Summary |
protected int[] |
doclens
|
protected int[] |
frequencies
frequencies of all of the stored postings |
Method Summary |
int |
getDocumentLength()
Return the length of the document for this posting. |
int |
getFrequency()
Return the frequency of the term in the current document |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
frequencies
protected int[] frequencies
- frequencies of all of the stored postings
doclens
protected int[] doclens
ArrayOfBasicIterablePosting
public ArrayOfBasicIterablePosting(int[] _ids,
int[] _freqs)
- Make a new posting list with these ids and frequencies
ArrayOfBasicIterablePosting
public ArrayOfBasicIterablePosting(int[] _ids,
int[] _freqs,
int[] _lens)
getFrequency
public int getFrequency()
- Return the frequency of the term in the current document
- Specified by:
getFrequency
in interface Posting
- Overrides:
getFrequency
in class ArrayOfIdsIterablePosting
- Returns:
- frequency of posting, in tokens
getDocumentLength
public int getDocumentLength()
- Description copied from class:
ArrayOfIdsIterablePosting
- Return the length of the document for this posting.
Usually uses the DocumentIndex, may do otherwise if
document length statistics are in posting list Returns 0.
- Specified by:
getDocumentLength
in interface Posting
- Overrides:
getDocumentLength
in class ArrayOfIdsIterablePosting
- Returns:
- length of the document of the current posting in tokens.
Terrier 3.6. Copyright © 2004-2011 University of Glasgow