public class CWI extends Object implements CWI
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).IDF_UNKNOWN
Constructor and Description |
---|
CWI()
Constructor for the CWI object.
|
Modifier and Type | Method and Description |
---|---|
void |
addLength(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(String term)
Test whether CWI contains the given term.
|
double |
idf(String term)
Return the inverse document frequency for the given term.
|
public boolean defined(String term)
public double idf(String term)
public void addTotalSize(long inc)
inc
- the amount by which to increasepublic void addLength(String term, long inc)
term
- the terminc
- the number of documents in which the term appearsCopyright © 2016 Egothor. All Rights Reserved.