public class CoOccurrence
extends java.lang.Object
CoOccurrenceMatrix. Dictionary items with
value -1 or 2, i.e. final terms. first and
second will be ordered lexically; The value associated with each CoOccurrence is the number of times first and second co-occur in the collection. The hash value associated with each CoOccurrence is the hash value of first + " " + second., Nina Tahmasebi, L3S Research Center
Term| Constructor and Description |
|---|
CoOccurrence(Term first,
Term second,
java.lang.Double frequency)
Sole constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj)
Compares two CoOccurrence a and b.
|
Term |
getFirst()
Returns the first term stored in this CoOccurrence
|
java.lang.Double |
getFrequency()
Returns the frequency with which the two terms stored, co-occur.
|
Term |
getSecond()
Returns the second term stored in this CoOccurrence
|
int |
hashCode()
Returns the hash value of first + " " + second
|
void |
incrementFrequency()
Increases the frequency of this CoOccurrence with one.
|
void |
setFirst(java.lang.String new_string) |
void |
setFrequency(java.lang.Double newFrequency)
Changes the frequency of this CoOccurrence to any
arbitrary double.
|
void |
setSecond(java.lang.String new_string) |
java.lang.String |
toString()
Returns a string representation of the terms in
the object separated with a space, followed by the frequency
|
public CoOccurrence(Term first, Term second, java.lang.Double frequency)
first - first term encounteredsecond - second term encounteredfrequency - the frequency with which first and second
co-occur within the collection.public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic Term getFirst()
public Term getSecond()
public java.lang.Double getFrequency()
public int hashCode()
hashCode in class java.lang.Objectpublic void incrementFrequency()
public void setFrequency(java.lang.Double newFrequency)
newFrequency - the new value to be usedpublic java.lang.String toString()
toString in class java.lang.Objectpublic void setSecond(java.lang.String new_string)
public void setFirst(java.lang.String new_string)