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})
def testCopyConstructor(self): s1 = Sentence(TEST_TOKENS) s1.addAnnotation("ann", 1) s2 = Sentence(s1) self.assertEqual(s2.getAnnotations("ann"), s1.getAnnotations("ann"))