smile.nlp.collocation
Class BigramCollocation
- java.lang.Object
-
- smile.nlp.collocation.BigramCollocation
-
- All Implemented Interfaces:
- java.lang.Comparable<BigramCollocation>
public class BigramCollocation extends java.lang.Object implements java.lang.Comparable<BigramCollocation>
Collocations are expressions of multiple words which commonly co-occur. A bigram collocation is a pair of words w1 w2 that appear together with statistically significance.
-
-
Constructor Summary
Constructors Constructor and Description BigramCollocation(java.lang.String w1, java.lang.String w2, int frequency, double score)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intcompareTo(BigramCollocation o)booleanequals(java.lang.Object obj)intfrequency()Returns the frequency of bigram in the corpus.inthashCode()doublescore()Returns the chi-square statistical score of the collocation.java.lang.StringtoString()java.lang.Stringw1()Returns the first word of bigram.java.lang.Stringw2()Returns the second word of bigram.
-
-
-
Constructor Detail
-
BigramCollocation
public BigramCollocation(java.lang.String w1, java.lang.String w2, int frequency, double score)Constructor.- Parameters:
w1- the first word of bigram.w2- the second word of bigram.frequency- the frequency of bigram in the corpus.score- the chi-square statistical score of collocation in a corpus.
-
-
Method Detail
-
w1
public java.lang.String w1()
Returns the first word of bigram.
-
w2
public java.lang.String w2()
Returns the second word of bigram.
-
frequency
public int frequency()
Returns the frequency of bigram in the corpus.
-
score
public double score()
Returns the chi-square statistical score of the collocation.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
compareTo
public int compareTo(BigramCollocation o)
- Specified by:
compareToin interfacejava.lang.Comparable<BigramCollocation>
-
-
DataMelt 3.0 © DataMelt by jWork.ORG