How to use the markovify.chain function in markovify

To help you get started, we’ve selected a few markovify examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jsvine / markovify / test / test_basic.py View on Github external
def test_make_sentence_with_start_three_words(self):
        start_str = "Sherlock Holmes was"
        text_model = self.sherlock_model
        try:
            text_model.make_sentence_with_start(start_str)
            assert(False)
        except markovify.text.ParamError:
            assert(True)
        text_model = self.sherlock_model_ss3
        text_model.make_sentence_with_start(start_str)
        sent = text_model.make_sentence_with_start("Sherlock")
        assert(markovify.chain.BEGIN not in sent)