Record Class Bigram
java.lang.Object
java.lang.Record
smile.nlp.Bigram
- Record Components:
w1- the first word of bigram.w2- the second word of bigram.count- the total number of occurrences of bigram in the corpus.score- the chi-square statistical score of the collocation in the corpus.
- All Implemented Interfaces:
Comparable<Bigram>
public record Bigram(String w1, String w2, int count, double score)
extends Record
implements Comparable<Bigram>
Bigrams or digrams are groups of two words, and are very commonly used
as the basis for simple statistical analysis of text. They are a special
case of N-gram.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintintcount()Returns the value of thecountrecord component.booleanIndicates whether some other object is "equal to" this one.inthashCode()Returns a hash code value for this object.doublescore()Returns the value of thescorerecord component.toString()Returns a string representation of this record class.w1()Returns the value of thew1record component.w2()Returns the value of thew2record component.
-
Constructor Details
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
compareTo
- Specified by:
compareToin interfaceComparable<Bigram>
-
w1
-
w2
-
count
-
score
-