Generate texts from start/end.

        Parameters
        ----------
        max_length : `int` or `None`
            Maximum sentence length.
        state_size : `int`
            State size.
        reply_to : `str` or `None`
            Input string.
        backward : `bool`
            `True` to generate text start.
        dataset: `str`
            Dataset key prefix.

        Returns
        -------
        `generator` of `str`
            Generated texts.

def generate_cont(self, max_length, state_size,
                      reply_to, backward, dataset):
        """Generate texts from start/end.

        Parameters
        ----------
        max_length : `int` or `None`
            Maximum sentence length.
        state_size : `int`
            State size.
        reply_to : `str` or `None`
            Input string.
        backward : `bool`
            `True` to generate text start.
        dataset: `str`
            Dataset key prefix.

        Returns
        -------
        `generator` of `str`
            Generated texts.
        """
        state = self.get_cont_state(reply_to, backward)
        while True:
            parts = self.generate(state_size, state, dataset, backward)
            if reply_to is not None:
                if backward:
                    parts = chain(reversed(list(parts)), (reply_to,))
                else:
                    parts = chain((reply_to,), parts)
            parts = islice(parts, 0, max_length)
            yield self.format(parts)