Пример #1
0
 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.')
Пример #2
0
 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.'
     )
Пример #3
0
 def test_that_handler_is_saving_dependency_parse(self):
     handler = SentenceHandler(self.test_sentence, self.corpus_item)
     handler.create_sentence()
     handler.save_sentence_dependecy_parses("basic-dependencies")
     sd = SentenceDependency.objects.all()
     self.assertEqual(sd.count(), 13)
Пример #4
0
 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)
Пример #5
0
 def test_sentence_handler_create_sentence(self):
     handler = SentenceHandler(self.test_sentence, self.corpus_item)
     handler.create_sentence()
     sentences = Sentence.objects.all()
     self.assertEqual(sentences.count(), 1)
Пример #6
0
 def test_that_handler_is_saving_dependency_parse(self):
     handler = SentenceHandler(self.test_sentence, self.corpus_item)
     handler.create_sentence()
     handler.save_sentence_dependecy_parses("basic-dependencies")
     sd = SentenceDependency.objects.all()
     self.assertEqual(sd.count(), 13)
Пример #7
0
 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)
Пример #8
0
 def test_sentence_handler_create_sentence(self):
     handler = SentenceHandler(self.test_sentence, self.corpus_item)
     handler.create_sentence()
     sentences = Sentence.objects.all()
     self.assertEqual(sentences.count(), 1)