org.terrier.structures.postings
Class PhraseIterablePosting

java.lang.Object
  extended by org.terrier.structures.postings.IterablePostingImpl
      extended by org.terrier.structures.postings.ANDIterablePosting
          extended by org.terrier.structures.postings.PhraseIterablePosting
All Implemented Interfaces:
Closeable, BlockPosting, IterablePosting, Posting

public class PhraseIterablePosting
extends ANDIterablePosting
implements BlockPosting

Implementation of an IterablePosting for block indices that returns only documents that match a multi-term phase.

Since:
3.5
Author:
Craig Macdonald

Field Summary
 
Fields inherited from class org.terrier.structures.postings.ANDIterablePosting
currentId, frequency, ips, termCount
 
Fields inherited from interface org.terrier.structures.postings.IterablePosting
EOL
 
Constructor Summary
PhraseIterablePosting(IterablePosting[] _ips, Pointer[] _p, boolean recordPositions)
           
 
Method Summary
 WritablePosting asWritablePosting()
          Copies this posting to one free of an iterator.
protected  boolean calculateFrequency()
          returns true if the document matches
static IterablePosting createPhrasePostingList(Pointer[] ps, PostingIndex<Pointer> invIndex, boolean savePositions)
           
static IterablePosting createPhrasePostingList(String[] terms, Lexicon<String> lex, PostingIndex<Pointer> invIndex, boolean savePositions)
           
 int[] getPositions()
          Return positions of occurrences
 
Methods inherited from class org.terrier.structures.postings.ANDIterablePosting
close, endOfPostings, getDocumentLength, getFrequency, getId, next, setId
 
Methods inherited from class org.terrier.structures.postings.IterablePostingImpl
next
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.terrier.structures.postings.Posting
getDocumentLength, getFrequency, getId, setId
 

Constructor Detail

PhraseIterablePosting

public PhraseIterablePosting(IterablePosting[] _ips,
                             Pointer[] _p,
                             boolean recordPositions)
                      throws IOException
Throws:
IOException
Method Detail

asWritablePosting

public WritablePosting asWritablePosting()
Description copied from interface: Posting
Copies this posting to one free of an iterator. Kind of like a clone.

Specified by:
asWritablePosting in interface Posting
Overrides:
asWritablePosting in class ANDIterablePosting
Returns:
an identical posting, but which can be maniulated free of this iterator

calculateFrequency

protected boolean calculateFrequency()
Description copied from class: ANDIterablePosting
returns true if the document matches

Overrides:
calculateFrequency in class ANDIterablePosting

getPositions

public int[] getPositions()
Description copied from interface: BlockPosting
Return positions of occurrences

Specified by:
getPositions in interface BlockPosting

createPhrasePostingList

public static IterablePosting createPhrasePostingList(Pointer[] ps,
                                                      PostingIndex<Pointer> invIndex,
                                                      boolean savePositions)
                                               throws IOException
Throws:
IOException

createPhrasePostingList

public static IterablePosting createPhrasePostingList(String[] terms,
                                                      Lexicon<String> lex,
                                                      PostingIndex<Pointer> invIndex,
                                                      boolean savePositions)
                                               throws IOException
Throws:
IOException


Terrier 3.6. Copyright © 2004-2011 University of Glasgow