예제 #1
0
 def test_count_tritransitive(self):
     files = [
         os.path.join(self.ditransitive_base,
                      "ungrammatical_but_parseable.txt")
     ]
     counter = ConstituentCounter(files)
     self.assertEqual(counter.count_ditransitive_verbs(), 0)
예제 #2
0
 def test_not_count_false_single_intransitive(self):
     files = [os.path.join(self.intransitive_base, "intransitive2.txt")]
     counter = ConstituentCounter(files)
     self.assertEqual(counter.count_intransitive_verbs(), 0)
예제 #3
0
 def test_count_sentences_two_files(self):
     # Each tree in ./test_corpora/sents/*.txt has 1 S
     files = (os.path.join(self.sent_base, f)
              for f in ("multiple_trees.txt", "test_second.txt"))
     counter = ConstituentCounter(files)
     self.assertEqual(counter.count_sentences(), 4)
예제 #4
0
 def test_count_sentences(self):
     # Each tree in ./test_corpora/sents/multiple_trees.txt has 1 S
     files = [os.path.join(self.sent_base, "multiple_trees.txt")]
     counter = ConstituentCounter(files)
     self.assertEqual(counter.count_sentences(), 3)
예제 #5
0
 def test_nested_ditransitive(self):
     files = [os.path.join(self.ditransitive_base, "ditransitive2.txt")]
     counter = ConstituentCounter(files)
     self.assertEqual(counter.count_ditransitive_verbs(), 2)