示例#1
0
 def testGetAnnotations(self):
     s = Sentence(TEST_TOKENS)
     a = s.addAnnotation('type1', 2, 4)
     a1 = s.addAnnotation('type2', 6)
     a2 = s.addAnnotation('type2', 8, 9)
     self.assertEqual(s.getAnnotations('type1'), {a})
     self.assertEqual(s.getAnnotations('type2'), {a1, a2})
示例#2
0
 def testGetAnnotations(self):
     s = Sentence(TEST_TOKENS)
     a = s.addAnnotation('type1', 2, 4)
     a1 = s.addAnnotation('type2', 6)
     a2 = s.addAnnotation('type2', 8, 9)
     self.assertEqual(s.getAnnotations('type1'), {a})
     self.assertEqual(s.getAnnotations('type2'), {a1, a2})
示例#3
0
 def testCopyConstructor(self):
     s1 = Sentence(TEST_TOKENS)
     s1.addAnnotation("ann", 1)
     s2 = Sentence(s1)
     self.assertEqual(s2.getAnnotations("ann"), s1.getAnnotations("ann"))
示例#4
0
 def testCopyConstructor(self):
     s1 = Sentence(TEST_TOKENS)
     s1.addAnnotation("ann", 1)
     s2 = Sentence(s1)
     self.assertEqual(s2.getAnnotations("ann"), s1.getAnnotations("ann"))