public class Bigram extends Bigram implements java.lang.Comparable<Bigram>
Modifier and Type | Field and Description |
---|---|
int |
count
The frequency of bigram in the corpus.
|
double |
score
The chi-square statistical score of the collocation.
|
Constructor and Description |
---|
Bigram(java.lang.String w1,
java.lang.String w2,
int count,
double score)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Bigram o) |
static Bigram[] |
of(Corpus corpus,
double p,
int minFrequency)
Finds bigram collocations in the given corpus whose p-value is less than
the given threshold.
|
static Bigram[] |
of(Corpus corpus,
int k,
int minFrequency)
Finds top k bigram collocations in the given corpus.
|
java.lang.String |
toString() |
public final int count
public final double score
public Bigram(java.lang.String w1, java.lang.String w2, int count, double score)
w1
- the first word of bigram.w2
- the second word of bigram.count
- the frequency of bigram in the corpus.score
- the chi-square statistical score of collocation in a corpus.public int compareTo(Bigram o)
compareTo
in interface java.lang.Comparable<Bigram>
public static Bigram[] of(Corpus corpus, int k, int minFrequency)
minFrequency
- The minimum frequency of bigram in the corpus.public static Bigram[] of(Corpus corpus, double p, int minFrequency)
p
- the p-value thresholdminFrequency
- The minimum frequency of bigram in the corpus.