Esempio n. 1
0
class TestThreeWordInput(TestCase):
    def setUp(self):
        self.dictionary = MarkovDictionary()
        self.source_text = "drink me now."
        self.dictionary.engorge(self.source_text)

    def test_disgorging_one_word(self):
        output = self.dictionary.disgorge(1)
        output_length = len(output.split(" "))
        self.assertEqual(output_length, 1)

    def test_disgorging_ten_words(self):
        output = self.dictionary.disgorge(10)
        length = len(output.split(" "))
        self.assertEqual(length, 10)

    def test_three_words_in_lexicon(self):
        length = len(self.dictionary.get_lexicon())
        self.assertEqual(length, 3)
Esempio n. 2
0
class TestThreeWordInput(TestCase):

  def setUp(self):
    self.dictionary = MarkovDictionary()
    self.source_text = "drink me now."
    self.dictionary.engorge(self.source_text)

  def test_disgorging_one_word(self):
    output = self.dictionary.disgorge(1)
    output_length = len(output.split(" "))
    self.assertEqual(output_length, 1)

  def test_disgorging_ten_words(self):
    output = self.dictionary.disgorge(10)  
    length = len(output.split(" "))
    self.assertEqual(length, 10)

  def test_three_words_in_lexicon(self):
    length = len(self.dictionary.get_lexicon())
    self.assertEqual(length, 3)
Esempio n. 3
0
def markov():
    return MarkovDictionary(request.get_data()).disgorge(600)
Esempio n. 4
0
 def setUp(self):
     self.dictionary = MarkovDictionary()
     self.source_text = "drink me now."
     self.dictionary.engorge(self.source_text)
Esempio n. 5
0
 def setUp(self):
   self.dictionary = MarkovDictionary()
   self.source_text = "drink me now."
   self.dictionary.engorge(self.source_text)