ISSearch
Class ISFeature

java.lang.Object
  extended byISSearch.ISFeature
All Implemented Interfaces:
ISFeatureInterface, Serializable

public class ISFeature
extends Object
implements ISFeatureInterface

Sample class that implements the ISFeatureInterface and represents one feature in the ISSearch search engine.

See Also:
Serialized Form

Field Summary
private  double rtf
          The Relative Term Frequency (RTF) weight of the feature in the document.
private  String term
          The term that is represented by this feature in the bag-of-words model.
private  double tf
          The absolute Term Frequency (TF) weight of the feature in the document.
 
Constructor Summary
ISFeature()
           
 
Method Summary
 double getRTF()
          Returns the Relative Term Frequency (RTF) weight of the feature in the document.
 String getTerm()
          Returns the term that is represented by this feature in the bag-of-words model.
 double getTF()
          Returns the absolute Term Frequency (TF) weight of the feature in the document.
 void setRTF(double r)
          Sets the RTF (Relative Term Frequency) weight of the feature.
 void setTerm(String t)
          Sets the term of the feature.
 void setTF(double t)
          Sets the TF (term frequency) weight of the feature.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

term

private String term
The term that is represented by this feature in the bag-of-words model. For compatibility reasons, we assume that all features are word stems generated by the Porter stemming algorithm from original words of the document after stopword removal. We also assume that all terms are converted to lowercase and trimmed usind String.toLowerCase() and String.trim() functions.


tf

private double tf
The absolute Term Frequency (TF) weight of the feature in the document. TF is defined as the total number of term occurences in the current document.


rtf

private double rtf
The Relative Term Frequency (RTF) weight of the feature in the document. RTF is defined as RTF / N, where N is the total number of terms in the current document.

Constructor Detail

ISFeature

public ISFeature()
Method Detail

getRTF

public double getRTF()
Returns the Relative Term Frequency (RTF) weight of the feature in the document.

Specified by:
getRTF in interface ISFeatureInterface
Returns:
The document-specific RTF weight of the feature.

getTF

public double getTF()
Returns the absolute Term Frequency (TF) weight of the feature in the document.

Specified by:
getTF in interface ISFeatureInterface
Returns:
The document-specific TF weight of the feature.

getTerm

public String getTerm()
Returns the term that is represented by this feature in the bag-of-words model.

Specified by:
getTerm in interface ISFeatureInterface
Returns:
The term that is represented by this feature.

setRTF

public void setRTF(double r)
Sets the RTF (Relative Term Frequency) weight of the feature.

Parameters:
r - The RTF weight of the feature.

setTF

public void setTF(double t)
Sets the TF (term frequency) weight of the feature.

Parameters:
t - The TF weight of the feature.

setTerm

public void setTerm(String t)
Sets the term of the feature.

Parameters:
t - The term (word stem) of the feature.