public class ContextVector
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
class |
ContextVector.Entry |
Constructor and Description |
---|
ContextVector()
Default constructor for
ContextVector . |
ContextVector(Term term)
Construct a context vector with a back reference to its owner term.
|
Modifier and Type | Method and Description |
---|---|
void |
addAllCooccurrences(java.util.Iterator<TermOccurrence> it) |
void |
addCooccurrence(TermOccurrence occ) |
void |
addEntry(Term coTerm,
int nbCooccs,
double assocRate) |
boolean |
equals(java.lang.Object obj) |
double |
getAssocRate(Term term) |
java.util.List<ContextVector.Entry> |
getEntries()
Gives the list of terms in this context vector sorted by frequency
(most frequent first)
|
int |
getNbCooccs(Term term) |
Term |
getTerm() |
int |
getTotalCoccurrences() |
int |
hashCode() |
void |
normalize()
Normalizes all
assocRates so that their sum is 1 |
void |
removeCoTerm(Term term) |
void |
setAssocRate(Term coTerm,
double assocRate) |
java.util.Set<Term> |
terms() |
java.lang.String |
toString() |
public ContextVector()
ContextVector
. Must be used if no normalization is required.public ContextVector(Term term)
term
- the owner termContextVector#toAssocRateVector(CrossTable, AssociationRate, boolean)
public void addAllCooccurrences(java.util.Iterator<TermOccurrence> it)
public void addCooccurrence(TermOccurrence occ)
public void addEntry(Term coTerm, int nbCooccs, double assocRate)
public void removeCoTerm(Term term)
public java.util.List<ContextVector.Entry> getEntries()
public void normalize()
assocRates
so that their sum is 1public int getNbCooccs(Term term)
public void setAssocRate(Term coTerm, double assocRate)
public double getAssocRate(Term term)
public java.util.Set<Term> terms()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public Term getTerm()
public java.lang.String toString()
toString
in class java.lang.Object
public int getTotalCoccurrences()