org.terrier.structures.indexing
Class BlockDocumentPostingList

java.lang.Object
  extended by org.terrier.structures.indexing.DocumentPostingList
      extended by org.terrier.structures.indexing.BlockDocumentPostingList

public class BlockDocumentPostingList
extends DocumentPostingList

Represents the postings of one document, and saves block (term position) information. Uses HashMaps internally.

Properties:

See Also:
DocumentPostingList

Nested Class Summary
 
Nested classes/interfaces inherited from class org.terrier.structures.indexing.DocumentPostingList
DocumentPostingList.postingIterator
 
Field Summary
protected  int blockCount
          number of blocks in this document.
protected  gnu.trove.THashMap<java.lang.String,gnu.trove.TIntHashSet> term_blocks
          mapping term to blockids in this document
 
Fields inherited from class org.terrier.structures.indexing.DocumentPostingList
AVG_DOCUMENT_UNIQUE_TERMS, documentLength, occurrences
 
Constructor Summary
BlockDocumentPostingList()
          Instantiate a new block document posting list.
 
Method Summary
 int[] getBlocks(java.lang.String term)
          return blocks
 int[][] getPostings()
          returns the postings suitable to be written into the block direct index
 void insert(java.lang.String t, int blockId)
          Insert a term into this document, occurs at given block id
protected  IterablePosting makePostingIterator(java.lang.String[] _terms, int[] termIds)
           
 
Methods inherited from class org.terrier.structures.indexing.DocumentPostingList
clear, forEachTerm, getDocumentLength, getDocumentStatistics, getFrequency, getNumberOfPointers, getPostings2, getTermId, insert, insert, termSet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

term_blocks

protected final gnu.trove.THashMap<java.lang.String,gnu.trove.TIntHashSet> term_blocks
mapping term to blockids in this document


blockCount

protected int blockCount
number of blocks in this document. usually equal to document length, but perhaps less

Constructor Detail

BlockDocumentPostingList

public BlockDocumentPostingList()
Instantiate a new block document posting list. Saves block information, but no fields

Method Detail

insert

public void insert(java.lang.String t,
                   int blockId)
Insert a term into this document, occurs at given block id


getBlocks

public int[] getBlocks(java.lang.String term)
return blocks

Parameters:
term -
Returns:
int[]

getPostings

public int[][] getPostings()
returns the postings suitable to be written into the block direct index

Overrides:
getPostings in class DocumentPostingList

makePostingIterator

protected IterablePosting makePostingIterator(java.lang.String[] _terms,
                                              int[] termIds)
Overrides:
makePostingIterator in class DocumentPostingList


Terrier 3.5. Copyright © 2004-2011 University of Glasgow