Package org.carrot2.text.vsm
Class TfTermWeighting
java.lang.Object
org.carrot2.attrs.AttrComposite
org.carrot2.text.vsm.TfTermWeighting
- All Implemented Interfaces:
AcceptingVisitor
,TermWeighting
public class TfTermWeighting extends AttrComposite implements TermWeighting
Calculates term-document matrix element values based on Term Frequency.
-
Field Summary
-
Constructor Summary
Constructors Constructor Description TfTermWeighting()
-
Method Summary
Modifier and Type Method Description double
calculateTermWeight(int termFrequency, int documentFrequency, int documentCount)
Calculates the weight of a term for a single document.
-
Constructor Details
-
TfTermWeighting
public TfTermWeighting()
-
-
Method Details
-
calculateTermWeight
public double calculateTermWeight(int termFrequency, int documentFrequency, int documentCount)Description copied from interface:TermWeighting
Calculates the weight of a term for a single document.- Specified by:
calculateTermWeight
in interfaceTermWeighting
- Parameters:
termFrequency
- frequency of the term in the documentdocumentFrequency
- the number of documents containing the termdocumentCount
- total number of documents
-