org.egothor.dir
Class CWI

java.lang.Object
  extended by org.egothor.dir.CWI
All Implemented Interfaces:
CWI

public class CWI
extends java.lang.Object
implements CWI

The CWI object represents the simplest case of Collection-Wide-Information in an Information Retrieval system. It stores inverse document frequency idf(java.lang.String). The frequency is computed from the total number of documents in the system (it can be modified via addTotalSize(long) calling), and from the number of documents which contain a given term/word (it can be modified via addLength(java.lang.String, long) calling).

Author:
Leo Galambos

Constructor Summary
CWI()
          Constructor for the CWI object.
 
Method Summary
 void addLength(java.lang.String term, long inc)
          Add the given term, which occurs in the given number of documents, to this CWI.
 void addTotalSize(long inc)
          Increase the number of documents in the system by the given amount.
 boolean defined(java.lang.String term)
          Test whether CWI contains the given term.
 double idf(java.lang.String term)
          Return the inverse document frequency for the given term.
protected  void reset(java.lang.String term)
          Description of the Method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CWI

public CWI()
Constructor for the CWI object.

Method Detail

defined

public boolean defined(java.lang.String term)
Test whether CWI contains the given term.

Specified by:
defined in interface CWI
Parameters:
term - the term
Returns:
true if it does, false otherwise

idf

public double idf(java.lang.String term)
Return the inverse document frequency for the given term.

Specified by:
idf in interface CWI
Parameters:
term - the term
Returns:
the inverse document frequency

addTotalSize

public void addTotalSize(long inc)
Increase the number of documents in the system by the given amount.

Parameters:
inc - the amount by which to increase

addLength

public void addLength(java.lang.String term,
                      long inc)
Add the given term, which occurs in the given number of documents, to this CWI.

Parameters:
term - the term
inc - the number of documents in which the term appears

reset

protected void reset(java.lang.String term)
Description of the Method

Parameters:
term - Description of the Parameter