Package org.carrot2.text.vsm
Class LinearTfIdfTermWeighting
- java.lang.Object
-
- org.carrot2.attrs.AttrComposite
-
- org.carrot2.text.vsm.LinearTfIdfTermWeighting
-
- All Implemented Interfaces:
AcceptingVisitor
,TermWeighting
public class LinearTfIdfTermWeighting extends AttrComposite implements TermWeighting
Calculates term-document matrix element values based on Linear Inverse Term Frequency.
-
-
Field Summary
-
Fields inherited from class org.carrot2.attrs.AttrComposite
attributes
-
-
Constructor Summary
Constructors Constructor Description LinearTfIdfTermWeighting()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
calculateTermWeight(int termFrequency, int documentFrequency, int documentCount)
Calculates the weight of a term for a single document.-
Methods inherited from class org.carrot2.attrs.AttrComposite
accept
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.carrot2.attrs.AcceptingVisitor
accept
-
-
-
-
Method Detail
-
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
-
-