### Question:
NGram { public NGram() { this.grams = new char[N_GRAM]; this.reset(); } NGram(); void addChar(char ch); String get(int n); static char normalize(char ch); static String normalize_vi(String text); static final int N_GRAM; static Map<Character, Character> cjk_map; }### Answer:
@Test public final void testNGram() { NGram ngram = new NGram(); assertEquals(ngram.get(0), null); assertEquals(ngram.get(1), null); assertEquals(ngram.get(2), null); assertEquals(ngram.get(3), null); assertEquals(ngram.get(4), null); ngram.addChar(' '); assertEquals(ngram.get(1), null); assertEquals(ngram.get(2), null); assertEquals(ngram.get(3), null); ngram.addChar('A'); assertEquals(ngram.get(1), "A"); assertEquals(ngram.get(2), " A"); assertEquals(ngram.get(3), null); ngram.addChar('\u06cc'); assertEquals(ngram.get(1), "\u064a"); assertEquals(ngram.get(2), "A\u064a"); assertEquals(ngram.get(3), " A\u064a"); ngram.addChar('\u1ea0'); assertEquals(ngram.get(1), "\u1ec3"); assertEquals(ngram.get(2), "\u064a\u1ec3"); assertEquals(ngram.get(3), "A\u064a\u1ec3"); ngram.addChar('\u3044'); assertEquals(ngram.get(1), "\u3042"); assertEquals(ngram.get(2), "\u1ec3\u3042"); assertEquals(ngram.get(3), "\u064a\u1ec3\u3042"); ngram.addChar('\u30a4'); assertEquals(ngram.get(1), "\u30a2"); assertEquals(ngram.get(2), "\u3042\u30a2"); assertEquals(ngram.get(3), "\u1ec3\u3042\u30a2"); ngram.addChar('\u3106'); assertEquals(ngram.get(1), "\u3105"); assertEquals(ngram.get(2), "\u30a2\u3105"); assertEquals(ngram.get(3), "\u3042\u30a2\u3105"); ngram.addChar('\uac01'); assertEquals(ngram.get(1), "\uac00"); assertEquals(ngram.get(2), "\u3105\uac00"); assertEquals(ngram.get(3), "\u30a2\u3105\uac00"); ngram.addChar('\u2010'); assertEquals(ngram.get(1), null); assertEquals(ngram.get(2), "\uac00 "); assertEquals(ngram.get(3), "\u3105\uac00 "); ngram.addChar('a'); assertEquals(ngram.get(1), "a"); assertEquals(ngram.get(2), " a"); assertEquals(ngram.get(3), null); }