

def add_char(self, ch):
    'Append a character into ngram buffer.'
    ch = self.normalize(ch)
    last_char = self.grams[(- 1)]
    if (last_char == ' '):
        self.grams = ' '
        self.capitalword = False
        if (ch == ' '):
            return
    elif (len(self.grams) >= self.N_GRAM):
        self.grams = last_char.grams[1:]
    self.grams += ch
    if ch.isupper():
        if last_char.isupper():
            self.capitalword = True
    else:
        self.capitalword = False

dataset/ETHPy150Open Mimino666/langdetect/langdetect/utils/ngram.py NGram.add_char/VarMisuse@89/125 `self`->`last_char`