|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.terrier.matching.dsms.PhraseScoreModifier
public class PhraseScoreModifier
Modifies the scores of the documents which contain, or do not contain a given phrase.
Field Summary | |
---|---|
protected static int |
BLOCK_SIZE
Number of tokens in one block. |
protected int |
blockDistance
The maximum distance, in blocks, that is allowed between the phrase terms. |
protected static org.apache.log4j.Logger |
logger
the logger for this class |
protected java.util.List<Query> |
phraseTerms
A list of the strings of the phrase terms. |
protected boolean |
required
Indicates whether the phrase should appear in the retrieved documents, or not. |
Constructor Summary | |
---|---|
PhraseScoreModifier(java.util.List<Query> pTerms)
Constructs a phrase score modifier for a given set of query terms. |
|
PhraseScoreModifier(java.util.List<Query> pTerms,
boolean r)
Constructs a phrase score modifier for a given set of query terms. |
|
PhraseScoreModifier(java.util.List<Query> pTerms,
boolean r,
int bDist)
Constructs a phrase score modifier for a given set of query terms, whether they are required to appear in a document, and the allowed distance between the phrase terms. |
|
PhraseScoreModifier(java.util.List<Query> pTerms,
int bDist)
Constructs a phrase score modifier for a given set of query terms and the allowed distance between them. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Clones this DSM. |
java.lang.String |
getName()
Returns the name of the modifier. |
boolean |
modifyScores(Index index,
MatchingQueryTerms terms,
ResultSet set)
Modifies the scores of documents, in which there exist, or there does not exist a given phrase. |
protected int[] |
range(int[] array,
int floor,
int ceiling)
Performs a binary search in an array and returns the indices of the array for which the elements of the array are higher and lower than the given floor and ceiling. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final org.apache.log4j.Logger logger
protected int blockDistance
protected java.util.List<Query> phraseTerms
protected boolean required
protected static final int BLOCK_SIZE
Constructor Detail |
---|
public PhraseScoreModifier(java.util.List<Query> pTerms)
pTerms
- ArrayList the terms that make up the query.public PhraseScoreModifier(java.util.List<Query> pTerms, int bDist)
pTerms
- ArrayList the terms that make up the query.bDist
- int the allowed distance between phrase terms.public PhraseScoreModifier(java.util.List<Query> pTerms, boolean r)
pTerms
- ArrayList the terms that make up the query.r
- boolean indicates whether the phrase is required.public PhraseScoreModifier(java.util.List<Query> pTerms, boolean r, int bDist)
pTerms
- ArrayList the terms that make up the query.r
- boolean indicates whether the phrase is required.bDist
- int the allowed distance between the phrase terms.Method Detail |
---|
public java.lang.String getName()
getName
in interface DocumentScoreModifier
public java.lang.Object clone()
clone
in interface DocumentScoreModifier
clone
in class java.lang.Object
public boolean modifyScores(Index index, MatchingQueryTerms terms, ResultSet set)
modifyScores
in interface DocumentScoreModifier
index
- Index the data structures to use.terms
- MatchingQueryTerms the terms to be matched for the query. This
does not correspond to the phrase terms necessarily, but to
all the terms of the query.set
- ResultSet the result set for the query.
protected int[] range(int[] array, int floor, int ceiling)
array
- the array to search infloor
- the lower limit of the range we want to check for.ceiling
- the upper limit of the range we want to check for.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |