public final class LanguageProfileImpl extends Object implements LanguageProfile
This class is immutable.
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
int |
getFrequency(String gram) |
@NotNull List<Integer> |
getGramLengths()
Tells what the n in n-grams are used here.
|
@NotNull LdLocale |
getLocale() |
long |
getMaxGramCount(int gramLength)
Tells how often the n-gram with the highest amount of occurrences used in this profile occurred.
|
long |
getMinGramCount(int gramLength)
Tells how often the n-gram with the lowest amount of occurrences used in this profile occurred.
|
long |
getNumGramOccurrences(int gramLength)
Tells how often all n-grams of a certain length occurred, combined.
|
int |
getNumGrams()
Tells how many n-grams there are for all n-gram sizes combined.
|
int |
getNumGrams(int gramLength)
Tells how many different n-grams there are for a certain n-gram size.
|
int |
hashCode() |
@NotNull Iterable<Map.Entry<String,Integer>> |
iterateGrams()
Iterates all ngram strings with frequency.
|
@NotNull Iterable<Map.Entry<String,Integer>> |
iterateGrams(int gramLength)
Iterates all gramLength-gram strings with frequency.
|
String |
toString() |
@NotNull public @NotNull LdLocale getLocale()
getLocale
in interface LanguageProfile
@NotNull public @NotNull List<Integer> getGramLengths()
LanguageProfile
getGramLengths
in interface LanguageProfile
public int getFrequency(String gram)
getFrequency
in interface LanguageProfile
gram
- for example "a" or "foo".public int getNumGrams(int gramLength)
LanguageProfile
getNumGrams
in interface LanguageProfile
gramLength
- 1-npublic int getNumGrams()
LanguageProfile
getNumGrams
in interface LanguageProfile
public long getNumGramOccurrences(int gramLength)
LanguageProfile
LanguageProfile.getNumGrams(int)
.getNumGramOccurrences
in interface LanguageProfile
gramLength
- 1-npublic long getMinGramCount(int gramLength)
LanguageProfile
getMinGramCount
in interface LanguageProfile
gramLength
- 1-npublic long getMaxGramCount(int gramLength)
LanguageProfile
getMaxGramCount
in interface LanguageProfile
gramLength
- 1-n@NotNull public @NotNull Iterable<Map.Entry<String,Integer>> iterateGrams()
LanguageProfile
iterateGrams
in interface LanguageProfile
@NotNull public @NotNull Iterable<Map.Entry<String,Integer>> iterateGrams(int gramLength)
LanguageProfile
iterateGrams
in interface LanguageProfile
Copyright © 2024. All rights reserved.