Package org.terrier.matching.matchops
Class PhraseOp
- java.lang.Object
-
- org.terrier.matching.matchops.Operator
-
- org.terrier.matching.matchops.MultiTermOp
-
- org.terrier.matching.matchops.ANDQueryOp
-
- org.terrier.matching.matchops.PhraseOp
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
public class PhraseOp extends ANDQueryOp
This combines multiple operators into a single op, where they occur adjacently. It is logically equivalent to Indri's #1() operator.- Since:
- 5.0
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
STRING_PREFIX
-
Fields inherited from class org.terrier.matching.matchops.MultiTermOp
logger
-
Fields inherited from class org.terrier.matching.matchops.Operator
IGNORE_LOW_IDF_TERMS
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected IterablePosting
createFinalPostingIterator(java.util.List<IterablePosting> postings, java.util.List<EntryStatistics> pointers)
protected EntryStatistics
mergeStatistics(EntryStatistics[] entryStats, CollectionStatistics collStats)
Adjust the statistics for this operator: 1.java.lang.String
toString()
-
Methods inherited from class org.terrier.matching.matchops.MultiTermOp
addStatistics, clone, getConstituents, getMatcher, getPostingIterator
-
-
-
-
Field Detail
-
STRING_PREFIX
public static final java.lang.String STRING_PREFIX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PhraseOp
public PhraseOp(Operator[] ts)
-
PhraseOp
public PhraseOp(java.lang.String[] ts)
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toString
in classANDQueryOp
-
mergeStatistics
protected EntryStatistics mergeStatistics(EntryStatistics[] entryStats, CollectionStatistics collStats)
Description copied from class:ANDQueryOp
Adjust the statistics for this operator: 1. The number of occurrences is the minimum of the constituent frequencies (handled by super). 2. The in-document maxTF is the minimum of the constituent maxTFs- Overrides:
mergeStatistics
in classANDQueryOp
-
createFinalPostingIterator
protected IterablePosting createFinalPostingIterator(java.util.List<IterablePosting> postings, java.util.List<EntryStatistics> pointers) throws java.io.IOException
- Overrides:
createFinalPostingIterator
in classANDQueryOp
- Throws:
java.io.IOException
-
-