static class LanguageProfilerBuilder.NGramEntry extends java.lang.Object implements java.lang.Comparable<LanguageProfilerBuilder.NGramEntry>
Modifier and Type | Field and Description |
---|---|
private int |
count
The number of occurences of this ngram in its profile
|
private float |
frequency
The frequency of this ngram in its profile
|
private LanguageProfilerBuilder |
profile
The NGRamProfile this NGram is related to
|
(package private) java.lang.CharSequence |
seq
The sequence of characters of the ngram
|
Constructor and Description |
---|
NGramEntry(java.lang.CharSequence seq)
Constructs a new NGramEntry
|
NGramEntry(java.lang.String seq,
int count)
Constructs a new NGramEntry
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(LanguageProfilerBuilder.NGramEntry ngram) |
boolean |
equals(java.lang.Object obj) |
int |
getCount()
Returns the number of occurrences of this ngram in its profile
|
float |
getFrequency()
Returns the frequency of this ngram in its profile
|
LanguageProfilerBuilder |
getProfile()
Returns the profile associated to this ngram
|
java.lang.CharSequence |
getSeq()
Returns the sequence of characters of this ngram
|
int |
hashCode() |
void |
inc()
Increments the number of occurrences of this ngram.
|
void |
setProfile(LanguageProfilerBuilder profile)
Associated a profile to this ngram
|
int |
size()
Returns the size of this ngram
|
java.lang.String |
toString() |
private LanguageProfilerBuilder profile
java.lang.CharSequence seq
private int count
private float frequency
public NGramEntry(java.lang.CharSequence seq)
seq
- is the sequence of characters of the ngrampublic NGramEntry(java.lang.String seq, int count)
seq
- is the sequence of characters of the ngramcount
- is the number of occurrences of this ngrampublic int getCount()
public float getFrequency()
public java.lang.CharSequence getSeq()
public int size()
public int compareTo(LanguageProfilerBuilder.NGramEntry ngram)
compareTo
in interface java.lang.Comparable<LanguageProfilerBuilder.NGramEntry>
public void inc()
public void setProfile(LanguageProfilerBuilder profile)
profile
- is the profile associated to this ngrampublic LanguageProfilerBuilder getProfile()
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object