public class RequiredTermModifier extends WeightingModel implements Serializable
averageDocumentLength, c, cs, documentFrequency, es, i, keyFrequency, numberOfDocuments, numberOfPointers, numberOfTokens, numberOfUniqueTerms, rq, termFrequency| Constructor and Description |
|---|
RequiredTermModifier(boolean r)
Constructs an instance of a TermInFieldModifier given the
requirement that the term should, or should not appear
in the query.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getInfo()
Returns the name of the model.
|
String |
getName()
Returns the name of the class and whether the query term is required.
|
int |
hashCode() |
int |
modifyScores(double[] scores,
int[][] pointers)
Resets the scores of documents for a particular term, based on
the requirement of appearance of the corresponding term.
|
double |
score(double tf,
double docLength)
This method provides the contract for implementing weighting models.
|
double |
score(double tf,
double docLength,
double n_t,
double F_t,
double _keyFrequency)
Deprecated.
|
double |
score(Posting p)
Returns score
|
clone, getOverflowed, getParameter, prepare, setCollectionStatistics, setEntryStatistics, setKeyFrequency, setParameter, setRequestpublic RequiredTermModifier(boolean r)
r - boolean indicates whether the term is required
to appear in the retrieved documents.public int modifyScores(double[] scores,
int[][] pointers)
scores - double[] the scores of the documents.pointers - int[][] the pointers read from the inverted file
for a particular query term.public String getName()
public String getInfo()
WeightingModelgetInfo in interface ModelgetInfo in class WeightingModelpublic double score(Posting p)
score in class WeightingModelpublic double score(double tf,
double docLength)
WeightingModelscore in class WeightingModeltf - The term frequency in the documentdocLength - the document's length@Deprecated public double score(double tf, double docLength, double n_t, double F_t, double _keyFrequency)
WeightingModelscore in class WeightingModeltf - The term frequency in the documentdocLength - the document's lengthn_t - The document frequency of the termF_t - the term frequency in the collection_keyFrequency - the term frequency in the queryTerrier 4.0. Copyright © 2004-2014 University of Glasgow