def test_that_sentence_can_be_rebuilt(self): handler = SentenceHandler(self.test_sentence, self.corpus_item) handler.create_sentence() handler.save_word_tokens() sentences = Sentence.objects.all() words = WordToken.objects.filter(sentence=sentences[0]) print words[0] sentence = rebuild_sentence_from_tokens(words) self.assertEqual(sentence, 'I had long been familiar with the area around the Boulevard Ornano.')
def test_that_sentence_can_be_rebuilt(self): handler = SentenceHandler(self.test_sentence, self.corpus_item) handler.create_sentence() handler.save_word_tokens() sentences = Sentence.objects.all() words = WordToken.objects.filter(sentence=sentences[0]) print words[0] sentence = rebuild_sentence_from_tokens(words) self.assertEqual( sentence, 'I had long been familiar with the area around the Boulevard Ornano.' )
def test_that_handler_is_saving_tokens(self): handler = SentenceHandler(self.test_sentence, self.corpus_item) handler.create_sentence() handler.save_word_tokens() wd = WordToken.objects.all() self.assertEqual(wd.count(), 13)