Ejemplo n.º 1
0
 def test_relevant_entities_one(self):
     entity = {'instances':[{'offset':0, 'length':5}]}
     self.assertEqual(calais_util.relevant_entities(
         [entity]), [entity])
Ejemplo n.º 2
0
 def test_relevant_entities_overlap_second(self):
     entities = [{'instances':[{'offset':4, 'length':5}]},
                 {'instances':[{'offset':0, 'length':5}]}]
     self.assertEqual(
         calais_util.relevant_entities(entities), [entities[1]])
Ejemplo n.º 3
0
 def test_relevant_entities_empty(self):
     self.assertEqual(calais_util.relevant_entities([]), [])
Ejemplo n.º 4
0
 def test_relevant_entities_no_overlap(self):
     entities = [{'instances':[{'offset':0, 'length':5}]},
                 {'instances':[{'offset':5, 'length':5}]}]
     self.assertEqual(calais_util.relevant_entities(entities), entities)