public void addChar(char ch){
  ch=normalize(ch);
  char lastchar=grams_.charAt(grams_.length() - 1);
  if (lastchar == ' ') {
    grams_=new StringBuffer(" ");
    capitalword_=false;
    if (ch == ' ')     return;
  }
 else   if (grams_.length() >= N_GRAM) {
    grams_.deleteCharAt(0);
  }
  grams_.append(ch);
  if (Character.isUpperCase(ch)) {
    if (Character.isUpperCase(lastchar))     capitalword_=true;
  }
 else {
    capitalword_=false;
  }
}

public void addChar ( char ch ) { ch = normalize ( ch ) ; char lastchar = grams_ . charAt ( grams_ . length ( ) - 1 ) ; if ( lastchar == ' ' ) { grams_ = new StringBuffer ( " " ) ; capitalword_ = false ; if ( ch == ' ' ) return ; } else if ( grams_ . length ( ) >= N_GRAM ) { grams_ . deleteCharAt ( 0 ) ; } grams_ . append ( ch ) ; if ( Character . isUpperCase ( ch ) ) { if ( Character . isUpperCase ( lastchar ) ) capitalword_ = true ; } else { capitalword_ = false ; } }
append a character into ngram buffer .
