org.terrier.structures.indexing
Class BlockLexiconMap

java.lang.Object
  extended by org.terrier.structures.indexing.LexiconMap
      extended by org.terrier.structures.indexing.BlockLexiconMap
Direct Known Subclasses:
BlockFieldLexiconMap

public class BlockLexiconMap
extends LexiconMap

LexiconMap implementation that also keeps track of the number of blocks that a term occurrs in. This is useful for sizing the block inverted index


Field Summary
protected  gnu.trove.TObjectIntHashMap<java.lang.String> blockFreqs
          Mapping term to blocks
protected  long numberOfBlocks
          Total number of blocks in this index
protected static byte zerob
           
protected static long zerol
           
 
Fields inherited from class org.terrier.structures.indexing.LexiconMap
BUNDLE_AVG_UNIQUE_TERMS, nts, numberOfNodes, numberOfPointers, tfs
 
Constructor Summary
BlockLexiconMap()
           
 
Method Summary
 void clear()
          Clear the lexicon map
 void insert(DocumentPostingList _doc)
          Inserts all the terms from a document posting into the lexicon map
 void insert(java.lang.String term, int tf, int blockfreq)
          Inserts a new term in the lexicon map.
 void storeToStream(LexiconOutputStream<java.lang.String> lexiconStream)
          Stores the lexicon map to a lexicon stream as a sequence of entries.
 
Methods inherited from class org.terrier.structures.indexing.LexiconMap
getNumberOfNodes, getNumberOfPointers, insert
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

zerob

protected static final byte zerob
See Also:
Constant Field Values

zerol

protected static final long zerol
See Also:
Constant Field Values

numberOfBlocks

protected long numberOfBlocks
Total number of blocks in this index


blockFreqs

protected final gnu.trove.TObjectIntHashMap<java.lang.String> blockFreqs
Mapping term to blocks

Constructor Detail

BlockLexiconMap

public BlockLexiconMap()
Method Detail

insert

public void insert(java.lang.String term,
                   int tf,
                   int blockfreq)
Inserts a new term in the lexicon map.

Parameters:
term - The term to be inserted.
tf - The id of the term.

clear

public void clear()
Clear the lexicon map

Overrides:
clear in class LexiconMap

insert

public void insert(DocumentPostingList _doc)
Inserts all the terms from a document posting into the lexicon map

Overrides:
insert in class LexiconMap
Parameters:
_doc - The postinglist for that document - must be a instance of BlockDocumentPostingList.

storeToStream

public void storeToStream(LexiconOutputStream<java.lang.String> lexiconStream)
                   throws java.io.IOException
Stores the lexicon map to a lexicon stream as a sequence of entries.

Overrides:
storeToStream in class LexiconMap
Parameters:
lexiconStream - The lexicon output stream to store to.
Throws:
java.io.IOException


Terrier 3.5. Copyright © 2004-2011 University of Glasgow