tp.model
Class FeatureFrequency

java.lang.Object
  extended by tp.model.FeatureFrequency
All Implemented Interfaces:
FeatureInterface

public class FeatureFrequency
extends java.lang.Object
implements FeatureInterface

Class representing a feature and its frequency in TF or TFIDF model.


Constructor Summary
FeatureFrequency(java.lang.String feature, int frequency)
          Constructor of the class
 
Method Summary
 java.lang.String getFeature()
          Gets a word, which is represented by this feature.
 int getRate()
          Gets a binary frequency of this feature.
 float getTF()
          Gets a TF weight of this feature.
 float getTFidf()
          Gets a TF-IDF weight of this feature.
 void setFeature(java.lang.String feature)
          Sets a word, which is represented by this feature.
 void setRate(int rate)
          Sets a binary frequency of this feature.
 void setTF(float tf)
          Sets a TF weight for this feature.
 void setTFidf(float tfidf)
          Sets a TF-IDF weight for this feature.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FeatureFrequency

public FeatureFrequency(java.lang.String feature,
                        int frequency)
Constructor of the class

Parameters:
feature - a feature (word)
frequency - a value of TF or TFIDF weight
Method Detail

getFeature

public java.lang.String getFeature()
Gets a word, which is represented by this feature.

Specified by:
getFeature in interface FeatureInterface
Returns:
a feature (word)

getRate

public int getRate()
Gets a binary frequency of this feature.

Specified by:
getRate in interface FeatureInterface
Returns:
value of frequency (0 or 1)

setFeature

public void setFeature(java.lang.String feature)
Sets a word, which is represented by this feature.

Specified by:
setFeature in interface FeatureInterface
Parameters:
feature - a feature (word)

setRate

public void setRate(int rate)
Sets a binary frequency of this feature.

Specified by:
setRate in interface FeatureInterface
Parameters:
rate - value of frequency (0 or 1)

getTFidf

public float getTFidf()
Gets a TF-IDF weight of this feature.

Returns:
value of TF-IDF weight

setTFidf

public void setTFidf(float tfidf)
Sets a TF-IDF weight for this feature.

Parameters:
tfidf - value of TF-IDF weight

getTF

public float getTF()
Gets a TF weight of this feature.

Returns:
value of TF weight

setTF

public void setTF(float tf)
Sets a TF weight for this feature.

Parameters:
tf - value of TF weight