@Deprecated
public class LangProfile
extends java.lang.Object
implements java.io.Serializable
LangProfile is a Language Profile Class.
Users don't use this class directly.
TODO split into builder and immutable class.
TODO currently this only makes n-grams with the space before a word included. no n-gram with the space after the word.
Example: "foo" creates " fo" as 3gram, but not "oo ". Either this is a bug, or if intended then needs documentation.| Modifier and Type | Field and Description |
|---|---|
private java.util.Map<java.lang.String,java.lang.Integer> |
freq
Deprecated.
Key = ngram, value = count.
|
private static int |
LESS_FREQ_RATIO
Deprecated.
Explanation by example:
If the most frequent n-gram occurs 1 mio times, then
1'000'000 / this (100'000) = 10.
|
private static int |
MINIMUM_FREQ
Deprecated.
n-grams that occur less than this often can be removed using omitLessFreq().
|
private java.lang.String |
name
Deprecated.
The language name (identifier).
|
private int[] |
nWords
Deprecated.
Tells how many occurrences of n-grams exist per gram length.
|
private static long |
serialVersionUID
Deprecated.
|
| Constructor and Description |
|---|
LangProfile()
Deprecated.
Constructor for JSONIC
|
LangProfile(java.lang.String name)
Deprecated.
Normal Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(@NotNull java.lang.String gram)
Deprecated.
Add n-gram to profile
|
java.util.Map<java.lang.String,java.lang.Integer> |
getFreq()
Deprecated.
|
java.lang.String |
getName()
Deprecated.
|
int[] |
getNWords()
Deprecated.
|
void |
omitLessFreq()
Deprecated.
Removes ngrams that occur fewer times than MINIMUM_FREQ to get rid of rare ngrams.
|
void |
setFreq(java.util.Map<java.lang.String,java.lang.Integer> freq)
Deprecated.
|
void |
setName(java.lang.String name)
Deprecated.
|
void |
setNWords(int[] nWords)
Deprecated.
|
private static final long serialVersionUID
private static final int MINIMUM_FREQ
private static final int LESS_FREQ_RATIO
private java.lang.String name
private java.util.Map<java.lang.String,java.lang.Integer> freq
private int[] nWords
public LangProfile()
public LangProfile(java.lang.String name)
name - language namepublic void add(@NotNull
@NotNull java.lang.String gram)
gram - public void omitLessFreq()
public java.lang.String getName()
public void setName(java.lang.String name)
public java.util.Map<java.lang.String,java.lang.Integer> getFreq()
public void setFreq(java.util.Map<java.lang.String,java.lang.Integer> freq)
public int[] getNWords()
public void setNWords(int[] nWords)