|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.terrier.matching.models.WeightingModel
org.terrier.matching.tsms.RequiredTermModifier
public class RequiredTermModifier
Resets the scores of documents according to whether a term is required or not, and whether it appears in the retrieved documents. This class implements the TermScoreModifier interface.
| Field Summary |
|---|
| Fields inherited from class org.terrier.matching.models.WeightingModel |
|---|
averageDocumentLength, c, documentFrequency, i, keyFrequency, numberOfDocuments, numberOfPointers, numberOfTokens, numberOfUniqueTerms, termFrequency |
| Constructor Summary | |
|---|---|
RequiredTermModifier(boolean r)
Constructs an instance of a TermInFieldModifier given the requirement that the term should, or should not appear in the query. |
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
Clone this weighting model |
java.lang.String |
getInfo()
Returns the name of the model. |
java.lang.String |
getName()
Returns the name of the modifier. |
int |
hashCode()
Returns a hash code of this object |
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)
This method provides the contract for implementing weighting models. |
double |
score(Posting p)
Returns score |
| Methods inherited from class org.terrier.matching.models.WeightingModel |
|---|
getOverflowed, getParameter, prepare, setAverageDocumentLength, setCollectionStatistics, setDocumentFrequency, setEntryStatistics, setKeyFrequency, setNumberOfDocuments, setNumberOfPointers, setNumberOfTokens, setNumberOfUniqueTerms, setParameter, setRequest, setTermFrequency, stirlingPower |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RequiredTermModifier(boolean r)
r - boolean indicates whether the term is required
to appear in the retrieved documents.| Method Detail |
|---|
public int modifyScores(double[] scores,
int[][] pointers)
modifyScores in interface TermScoreModifierscores - double[] the scores of the documents.pointers - int[][] the pointers read from the inverted file
for a particular query term.
public java.lang.String getName()
getName in interface TermScoreModifierpublic int hashCode()
hashCode in interface TermScoreModifierhashCode in class java.lang.Objectpublic java.lang.Object clone()
clone in interface TermScoreModifierclone in class WeightingModelpublic java.lang.String getInfo()
WeightingModel
getInfo in interface ModelgetInfo in class WeightingModelpublic double score(Posting p)
score in class WeightingModel
public double score(double tf,
double docLength)
WeightingModel
score in class WeightingModeltf - The term frequency in the documentdocLength - the document's length
public double score(double tf,
double docLength,
double n_t,
double F_t,
double keyFrequency)
WeightingModel
score 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 collectionkeyFrequency - the term frequency in the query
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||