Class P
- java.lang.Object
-
- org.terrier.matching.models.basicmodel.BasicModel
-
- org.terrier.matching.models.basicmodel.P
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
- Direct Known Subclasses:
PL
public class P extends BasicModel
This class implements the P basic model for randomness.- Author:
- Gianni Amati, Ben He, Vassilis Plachouras
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringmodelNameThe name of the model.-
Fields inherited from class org.terrier.matching.models.basicmodel.BasicModel
i, numberOfDocuments, numberOfTokens
-
-
Constructor Summary
Constructors Constructor Description P()A default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetInfo()Returns the name of the model.doublescore(double tf, double documentFrequency, double termFrequency, double keyFrequency, double documentLength)This method provides the contract for implementing weighting models.-
Methods inherited from class org.terrier.matching.models.basicmodel.BasicModel
clone, setNumberOfDocuments, setNumberOfTokens, stirlingPower
-
-
-
-
Method Detail
-
getInfo
public java.lang.String getInfo()
Returns the name of the model.- Specified by:
getInfoin classBasicModel- Returns:
- the name of the model
-
score
public double score(double tf, double documentFrequency, double termFrequency, double keyFrequency, double documentLength)This method provides the contract for implementing weighting models.- Specified by:
scorein classBasicModel- Parameters:
tf- The term frequency in the documentdocumentFrequency- The document frequency of the termtermFrequency- the term frequency in the collectiondocumentLength- The length of the document.keyFrequency- The normalised query term frequency.- Returns:
- the score returned by the implemented weighting model.
-
-