com.cybozu.labs.langdetect.util

## Class NGram

- java.lang.Object
- - com.cybozu.labs.langdetect.util.NGram

-     public class NGram
      extends java.lang.Object

  Cut out N-gram from text. Users don't use this class directly.
  Author:
    Nakatani Shuyo

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `(package private) static java.lang.String[]` | `CJK_CLASS` CJK Kanji Normalization Mapping
    `static java.util.HashMap<java.lang.Character,java.lang.Character>` | `cjk_map`
    `static int` | `N_GRAM`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `NGram()` Constructor.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addChar(char ch)` Append a character into ngram buffer.
    `java.lang.String` | `get(int n)` Get n-Gram
    `static java.lang.String` | `normalize_vi(java.lang.String text)` Normalizer for Vietnamese.
    `static char` | `normalize(char ch)` Character Normalization

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### N_GRAM

          public static final int N_GRAM

      See Also:
        Constant Field Values

    - #### cjk_map

          public static java.util.HashMap<java.lang.Character,java.lang.Character> cjk_map

    - #### CJK_CLASS

          static final java.lang.String[] CJK_CLASS

      CJK Kanji Normalization Mapping

  - ### Constructor Detail

    - #### NGram

          public NGram()

      Constructor.

  - ### Method Detail

    - #### addChar

          public void addChar(char ch)

      Append a character into ngram buffer.
      Parameters:
        `ch` -

    - #### get

          public java.lang.String get(int n)

      Get n-Gram
      Parameters:
        `n` - length of n-gram
      Returns:
        n-Gram String (null if it is invalid)

    - #### normalize

          public static char normalize(char ch)

      Character Normalization
      Parameters:
        `ch` -
      Returns:
        Normalized character

    - #### normalize_vi

          public static java.lang.String normalize_vi(java.lang.String text)

      Normalizer for Vietnamese. Normalize Alphabet + Diacritical Mark(U+03xx) into U+1Exx .
      Parameters:
        `text` -
      Returns:
        normalized text