datapreparation.weighting
Class TermCollection

java.lang.Object
  extended by datapreparation.weighting.TermCollection

public class TermCollection
extends java.lang.Object

Class implementing a term collection. A term collection consists of a list of terms with total frequence (sum of frequence in all texts) and the number of text the term is present in.

Author:
Kjell-Inge Skogstad and Trond Řivind Eriksen

Constructor Summary
TermCollection()
          Constructor creating a new hashtable for storing terms.
 
Method Summary
 void fillCollection(DataSet set)
          Method for filling the collection.
 int getFrequency(java.lang.String term)
          Method for getting the total frequency of a given term.
 int getNofTexts(java.lang.String term)
          Method for getting the number of texts the given term is present in.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TermCollection

public TermCollection()
Constructor creating a new hashtable for storing terms.

Method Detail

fillCollection

public void fillCollection(DataSet set)
Method for filling the collection. A dataSet is given and parsed so that all individual terms are stored in the collection.

Parameters:
set - The dataset

getFrequency

public int getFrequency(java.lang.String term)
Method for getting the total frequency of a given term.

Parameters:
term - The term
Returns:
The frequency

getNofTexts

public int getNofTexts(java.lang.String term)
Method for getting the number of texts the given term is present in.

Parameters:
term - The term
Returns:
The number of texts