tp.model
Class DocRepresentTable

java.lang.Object
  extended by tp.model.DocRepresentTable

public class DocRepresentTable
extends java.lang.Object

Represents a table of one document representation.


Constructor Summary
DocRepresentTable()
          Constructor of the class.
 
Method Summary
 void addFeature(java.lang.String feature)
          Method inserts directly features to a binary representation
 void addFeature(java.lang.String feature, java.lang.Integer frequency)
          Method inserts directly features and their frequencies
 java.util.ArrayList<FeatureInterface> getArrayFeaturesFrequency()
          Method returs the whole representation of a document with all features.
 int getFeatureBinary(java.lang.String f)
          Method returns occurence of a feature (for binary model)
 double getFeatureTF(java.lang.String f)
          Method returns a term frequency a feature, wich is given as a parameter
 double getFeatureTFidf(java.lang.String f)
          Method returns a TFIDF weight a feature, which is given as a parameter
 java.lang.String getTopic()
          Returns a class of represented document.
 void includeFeature(java.lang.String f, DocsRepresentDB.RepresentationModel model)
          Method adds a new feature to the representation, if it does not exist.
 void setTopic(java.lang.String topic)
          Sets a class of represented document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocRepresentTable

public DocRepresentTable()
Constructor of the class.

Method Detail

includeFeature

public void includeFeature(java.lang.String f,
                           DocsRepresentDB.RepresentationModel model)
Method adds a new feature to the representation, if it does not exist. If it exists, its occurence is increased.

Parameters:
f - a feature
model - model of representation (binary/tf/tf-idf)

addFeature

public void addFeature(java.lang.String feature,
                       java.lang.Integer frequency)
Method inserts directly features and their frequencies

Parameters:
feature - a feature (word)
frequency - frequency of a feature

addFeature

public void addFeature(java.lang.String feature)
Method inserts directly features to a binary representation

Parameters:
feature - a new feature

getFeatureTF

public double getFeatureTF(java.lang.String f)
Method returns a term frequency a feature, wich is given as a parameter

Parameters:
feature - a given feature
Returns:
term frequency of a feature

getFeatureTFidf

public double getFeatureTFidf(java.lang.String f)
Method returns a TFIDF weight a feature, which is given as a parameter

Parameters:
feature - a given feature
Returns:
TFIDF weight of a feature

getFeatureBinary

public int getFeatureBinary(java.lang.String f)
Method returns occurence of a feature (for binary model)

Parameters:
feature - a given feature
Returns:
(binary) occurence of a feature

getArrayFeaturesFrequency

public java.util.ArrayList<FeatureInterface> getArrayFeaturesFrequency()
Method returs the whole representation of a document with all features.

Returns:
array of features and their frequencies

getTopic

public java.lang.String getTopic()
Returns a class of represented document.

Returns:
a class in a form of string

setTopic

public void setTopic(java.lang.String topic)
Sets a class of represented document.

Parameters:
a - class in a form of string