'Add a sample to the model of text for this generator.'

def add_sample(self, sample):

    if (len(sample) <= self.order):
        return
    start = sample[:self.order]
    self.starts[start] += 1
    self.start_lengths[start][len(sample)] += 1
    for (order, model) in enumerate(self.models, 1):
        for chars in self._in_groups(sample, (order + 1)):
            prefix = ''.join(chars[:(-1)])
            next_char = chars[(-1)]
            model[prefix][next_char] += 1
