Class NGram
- java.lang.Object
-
- com.optimaize.langdetect.cybozu.util.NGram
-
public class NGram extends java.lang.Object
TODO document. Users don't use this class directly. TODO this class treats a word as "upper case" if the first 2 characters are upper case. That seems like a simplification, would need documentation.
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
capitalword_
private java.lang.StringBuilder
grams_
static int
N_GRAM
ngrams are created from 1gram to this amount, currently 2grams and 3grams.
-
Constructor Summary
Constructors Constructor Description NGram()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChar(char ch)
@Nullable java.lang.String
get(int n)
TODO this method has some weird, undocumented behavior to ignore ngrams with upper case.
-
-
-
Field Detail
-
N_GRAM
public static final int N_GRAM
ngrams are created from 1gram to this amount, currently 2grams and 3grams.- See Also:
- Constant Field Values
-
grams_
private java.lang.StringBuilder grams_
-
capitalword_
private boolean capitalword_
-
-