public class PhraseScoreModifier extends Object implements DocumentScoreModifier
Modifier and Type | Field and Description |
---|---|
protected int |
blockDistance
The maximum distance, in blocks, that is allowed between the phrase
terms.
|
protected static org.slf4j.Logger |
logger
the logger for this class
|
protected 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 and Description |
---|
PhraseScoreModifier(List<Query> pTerms)
Constructs a phrase score modifier for a given set of query terms.
|
PhraseScoreModifier(List<Query> pTerms,
boolean r)
Constructs a phrase score modifier for a given set of query terms.
|
PhraseScoreModifier(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(List<Query> pTerms,
int bDist)
Constructs a phrase score modifier for a given set of query terms and the
allowed distance between them.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Clones this DSM.
|
String |
getName()
Returns the name of the document score modifier.
|
boolean |
modifyScores(Index index,
MatchingQueryTerms terms,
ResultSet resultSet)
Modifies the scores of the documents for a given
query.
|
protected static final org.slf4j.Logger logger
protected int blockDistance
protected boolean required
public PhraseScoreModifier(List<Query> pTerms)
pTerms
- ArrayList the terms that make up the query.public PhraseScoreModifier(List<Query> pTerms, int bDist)
pTerms
- ArrayList the terms that make up the query.bDist
- int the allowed distance between phrase terms.public PhraseScoreModifier(List<Query> pTerms, boolean r)
pTerms
- ArrayList the terms that make up the query.r
- boolean indicates whether the phrase is required.public PhraseScoreModifier(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.public boolean modifyScores(Index index, MatchingQueryTerms terms, ResultSet resultSet)
DocumentScoreModifier
modifyScores
in interface DocumentScoreModifier
index
- Index the data structures used for retrieval.terms
- TermTreeNodes[] the query termsresultSet
- ResultSet the current set of results.public String getName()
DocumentScoreModifier
getName
in interface DocumentScoreModifier
public Object clone()
clone
in interface DocumentScoreModifier
clone
in class Object
Terrier Information Retrieval Platform4.1. Copyright © 2004-2015, University of Glasgow