def get_governing_geo(text, return_source=False): TRIGGER_lIST_GOVERNING = ["governed", "governing law"] found_governing = False geo_entity = None for g in TRIGGER_lIST_GOVERNING: if (findWholeWordorPhrase(g)(text)) is not None: found_governing = True break if found_governing: found_geo_entities = list(get_geopolitical(text)) if len(found_geo_entities) > 0: # take first geo_entity geo_entity = found_geo_entities[0] if return_source: return geo_entity, text else: return geo_entity
def extract_geopolitical(self, text=None): if not text: text = self.text return list(lex_entities.get_geopolitical(text))