'Generator; takes 3 args: nbr_symbols, max_length, nbr_cases.'

@property
def train_generator(self):

    def _gen(nbr_symbols, max_length, nbr_cases):
        plain_vocab = range(nbr_symbols)
        indices = generate_plaintext_random(plain_vocab, self.distribution, nbr_cases, max_length)
        codes = encipher_shift(indices, plain_vocab, self.shift)
        for (plain, code) in zip(indices, codes):
            (yield {'inputs': plain, 'targets': code})
    return _gen
