|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.labs.minion.retrieval.QueryElement com.sun.labs.minion.retrieval.Operator com.sun.labs.minion.retrieval.Proximity
public abstract class Proximity
An abstract class for all proximity operators. This class includes the methods common to all such operators.
Field Summary | |
---|---|
protected float |
gapPenalty
The penalty to assign for a gap in a passage, per word. |
protected static java.lang.String |
logTag
|
protected int |
maxMissing
The maximum number of terms that may be missing from a qualifying passage. |
protected int |
maxWindow
The maximum window size for a qualifying passage. |
protected int |
minWindow
The minimum window size for a qualifying passage. |
protected boolean[] |
ocTerms
Which of the terms in the query were generated by ONECHAR operators? |
protected float |
oooPenalty
The additionaly penalty to assign to a gap between terms that are out of order in the passage. |
protected QueryElement[] |
orderedOps
The operands in the order in which they appear in the query. |
protected boolean |
storePassages
Whether we need to store passages or no. |
protected DictTerm[] |
terms
The dictionary terms from the query, in the order given in the query. |
Fields inherited from class com.sun.labs.minion.retrieval.Operator |
---|
operands |
Fields inherited from class com.sun.labs.minion.retrieval.QueryElement |
---|
estSize, fieldMultipliers, inOrder, keepPositions, order, part, qc, qs, searchFieldNames, searchFields, strictEval, wc, wf |
Constructor Summary | |
---|---|
Proximity(java.util.List operands)
Builds a proximity operator from a list of operands. |
Method Summary | |
---|---|
protected void |
arrayCopy(int[] src,
int srcPos,
int[] dst,
int dstPos,
int len)
|
protected float |
calcPenalty(int[] posns)
Calculates the penalty produced by a set of positions from a document. |
protected float |
checkPositions(ScoredGroup ag,
int field,
int[][] columns,
int[] lens,
boolean[] ocColumn,
float[][] termPens)
Finds qualifying passages in the given positions. |
protected ArrayGroup |
evalTerms(ArrayGroup candidates,
java.util.List terms)
Evaluates a set of terms against the current constraints, returning the results. |
protected static java.lang.String |
printCols(int[][] columns,
int[] lens)
|
protected void |
setGap(float p)
Sets the gap penalty. |
protected void |
setOOO(float p)
Sets the out-of-order penalty. |
protected void |
setStorePassages(boolean b)
Sets the flag indicating whether we should store passages when doing retrieval. |
protected void |
setWindow(int w)
Sets the maximum window. |
Methods inherited from class com.sun.labs.minion.retrieval.Operator |
---|
addSearchFieldName, getOperands, getQueryTerms, setOperands, setPartition, setQueryConfig, setWeightingComponents, setWeightingFunction, toString, toString, toStringMod |
Methods inherited from class com.sun.labs.minion.retrieval.QueryElement |
---|
calculateEstimatedSize, compareTo, dump, estimateSize, eval, getInOrder, getOrder, getQueryStats, getQueryTerms, getSearchFieldNames, setInOrder, setOrder, setQueryStats, setSearchFields |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected int maxMissing
protected int minWindow
protected int maxWindow
protected float gapPenalty
protected float oooPenalty
protected QueryElement[] orderedOps
protected DictTerm[] terms
protected boolean[] ocTerms
protected boolean storePassages
protected static java.lang.String logTag
Constructor Detail |
---|
public Proximity(java.util.List operands)
Method Detail |
---|
protected void setOOO(float p)
protected void setGap(float p)
protected void setWindow(int w)
protected void setStorePassages(boolean b)
protected ArrayGroup evalTerms(ArrayGroup candidates, java.util.List terms)
candidates
- A candidate set of documents, generated by one of
the subclasses.terms
- The terms for which we wish to compute the proximity
constraints. The list must contain instances of
DictTerm
.protected float calcPenalty(int[] posns)
posns
- The set of positions for which we wish to calculate the
penalty. Missing terms may be indicated by values less than zero.
protected float checkPositions(ScoredGroup ag, int field, int[][] columns, int[] lens, boolean[] ocColumn, float[][] termPens)
ag
- The ScoredGroup
where we'll add our passages.field
- The ID of the field that we're currently processing.columns
- The word positions for each column, in order.lens
- The lengths of the columns.ocColumn
- If the ith element is
true
then the ith column was
generated by a onchar
operator.termPens
- The penalties inherent in the terms.
Float.MIN_VALUE
is returned.protected static java.lang.String printCols(int[][] columns, int[] lens)
protected void arrayCopy(int[] src, int srcPos, int[] dst, int dstPos, int len)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |