Package org.terrier.structures.indexing
Class BlockFieldDocumentPostingList
- java.lang.Object
-
- org.terrier.structures.indexing.DocumentPostingList
-
- org.terrier.structures.indexing.FieldDocumentPostingList
-
- org.terrier.structures.indexing.BlockFieldDocumentPostingList
-
- All Implemented Interfaces:
java.io.Serializable,org.apache.hadoop.io.Writable
public class BlockFieldDocumentPostingList extends FieldDocumentPostingList
BlockFieldDocumentPostingList class- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.terrier.structures.indexing.DocumentPostingList
DocumentPostingList.postingIterator
-
-
Field Summary
Fields Modifier and Type Field Description protected intblockCountnumber of blocks in this document.protected gnu.trove.THashMap<java.lang.String,gnu.trove.TIntHashSet>term_blocksmapping term to blockids in this document-
Fields inherited from class org.terrier.structures.indexing.FieldDocumentPostingList
field_occurrences, fieldCount, fieldLengths
-
Fields inherited from class org.terrier.structures.indexing.DocumentPostingList
AVG_DOCUMENT_UNIQUE_TERMS, documentLength, occurrences
-
-
Constructor Summary
Constructors Constructor Description BlockFieldDocumentPostingList(int NUM_FIELDS)Constructs an instance of BlockFieldDocumentPostingList.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int[]getBlocks(java.lang.String term)Get the blocks for the specified termint[][]getPostings(TermCodes termCodes)returns the postings suitable to be written into the block direct indexvoidinsert(int tf, java.lang.String t, int[] fieldIds, int blockId)Insert a term into this document tf times, occurs at given block id, and in the given fieldsvoidinsert(java.lang.String t, int[] fieldIds, int blockId)Insert a term into this document, occurs at given block id, and in the given fieldsvoidinsert(java.lang.String t, int fieldId, int blockId)Insert a term into this document, occurs at given block id, and in the given fieldprotected IterablePostingmakePostingIterator(java.lang.String[] _terms, int[] termIds)voidreadFields(java.io.DataInput in)voidwrite(java.io.DataOutput out)-
Methods inherited from class org.terrier.structures.indexing.FieldDocumentPostingList
clear, getDocumentStatistics, getFieldFrequencies, insert, insert, insert, insert
-
Methods inherited from class org.terrier.structures.indexing.DocumentPostingList
forEachTerm, getDocumentLength, getFrequency, getNumberOfPointers, getPostings2, insert, insert, termSet
-
-
-
-
Method Detail
-
getBlocks
public int[] getBlocks(java.lang.String term)
Get the blocks for the specified term
-
insert
public void insert(java.lang.String t, int fieldId, int blockId)Insert a term into this document, occurs at given block id, and in the given field
-
insert
public void insert(java.lang.String t, int[] fieldIds, int blockId)Insert a term into this document, occurs at given block id, and in the given fields
-
insert
public void insert(int tf, java.lang.String t, int[] fieldIds, int blockId)Insert a term into this document tf times, occurs at given block id, and in the given fields
-
getPostings
public int[][] getPostings(TermCodes termCodes)
returns the postings suitable to be written into the block direct index- Overrides:
getPostingsin classFieldDocumentPostingList
-
makePostingIterator
protected IterablePosting makePostingIterator(java.lang.String[] _terms, int[] termIds)
- Overrides:
makePostingIteratorin classFieldDocumentPostingList
-
readFields
public void readFields(java.io.DataInput in) throws java.io.IOException- Specified by:
readFieldsin interfaceorg.apache.hadoop.io.Writable- Overrides:
readFieldsin classFieldDocumentPostingList- Throws:
java.io.IOException
-
write
public void write(java.io.DataOutput out) throws java.io.IOException- Specified by:
writein interfaceorg.apache.hadoop.io.Writable- Overrides:
writein classFieldDocumentPostingList- Throws:
java.io.IOException
-
-