def test_michigan_coords(self):
     text = 'This Contract (“Contract”) is entered into by and between ' +\
            'the City of Detroit, a Michigan municipal corporation'
     ants = list(get_geoentity_annotations(text, GEO_CONFIG))
     self.assertEqual(1, len(ants))
     fragment = text[ants[0].coords[0]:ants[0].coords[1]]
     self.assertEqual('Michigan', fragment)
Exemplo n.º 2
0
 def test_get_geo(self):
     text = '''This Contract (“Contract”) is entered into by and between the City of Detroit, a Michigan municipal corporation'''
     geos = list(get_geoentity_annotations(text, _CONFIG))
     self.assertEqual(1, len(geos))
     s, e = geos[0].coords
     text_part = text[s:e]
     self.assertEqual('Michigan', text_part)
def parse_geo_annotations(text: str) -> List[GeoAnnotation]:
    ants = list(get_geoentity_annotations(text, GEO_CONFIG))
    return ants