def test_finds_highest_order_solution_first(self): mc = MarkovChain(self.corpus, 3) mc.fit() nextw = mc.next_word(['alpha','beta','gamma']) self.assertEqual(nextw, 'delta')
def test_second_best_solution_next(self): mc = MarkovChain(self.corpus, 3) mc.fit() # TODO: Make sure it tests for beta delta together first? nextw = mc.next_word(['beta','delta']) self.assertEqual(nextw, 'alpha')
def test_probs_stop_across_lines(self): mc = MarkovChain(self.corpus, 3) mc.fit() nextw = mc.next_word(['alpha','epsilon']) self.assertEqual(nextw, '\n') # Nothing follows epsilon