Package org.terrier.structures.postings
Class ProximityIterablePosting
- java.lang.Object
-
- org.terrier.structures.postings.IterablePostingImpl
-
- org.terrier.structures.postings.ANDIterablePosting
-
- org.terrier.structures.postings.ProximityIterablePosting
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,IterablePosting
,Posting
public class ProximityIterablePosting extends ANDIterablePosting
Implementation of an IterablePosting for block indices that returns only documents that match phases within a fixed window size.- Since:
- 3.6
- Author:
- Matteo Catena and Richard McCreadie
-
-
Field Summary
Fields Modifier and Type Field Description protected int
window
-
Fields inherited from class org.terrier.structures.postings.ANDIterablePosting
currentId, frequency, ips, termCount
-
Fields inherited from interface org.terrier.structures.postings.IterablePosting
END_OF_LIST, EOL
-
-
Constructor Summary
Constructors Constructor Description ProximityIterablePosting(IterablePosting[] _ips, EntryStatistics[] _es, int window)
ProximityIterablePosting(IterablePosting[] _ips, Pointer[] _p, int window)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
calculateFrequency()
returns true if the document matchesstatic IterablePosting
createProximityPostingList(java.lang.String[] terms, Lexicon<java.lang.String> lex, PostingIndex<Pointer> invIndex, int blockDistance)
static IterablePosting
createProximityPostingList(Pointer[] ps, PostingIndex<Pointer> invIndex, int blockDistance)
-
Methods inherited from class org.terrier.structures.postings.ANDIterablePosting
asWritablePosting, close, endOfPostings, getDocumentLength, getFrequency, getId, next, next
-
-
-
-
Constructor Detail
-
ProximityIterablePosting
public ProximityIterablePosting(IterablePosting[] _ips, EntryStatistics[] _es, int window) throws java.io.IOException
- Throws:
java.io.IOException
-
ProximityIterablePosting
public ProximityIterablePosting(IterablePosting[] _ips, Pointer[] _p, int window) throws java.io.IOException
- Throws:
java.io.IOException
-
-
Method Detail
-
calculateFrequency
protected boolean calculateFrequency()
Description copied from class:ANDIterablePosting
returns true if the document matches- Overrides:
calculateFrequency
in classANDIterablePosting
-
createProximityPostingList
public static IterablePosting createProximityPostingList(Pointer[] ps, PostingIndex<Pointer> invIndex, int blockDistance) throws java.io.IOException
- Throws:
java.io.IOException
-
createProximityPostingList
public static IterablePosting createProximityPostingList(java.lang.String[] terms, Lexicon<java.lang.String> lex, PostingIndex<Pointer> invIndex, int blockDistance) throws java.io.IOException
- Throws:
java.io.IOException
-
-