| import herramientas | |
| import tools.ine_antes as ine_antes_tools | |
| def vigencia(textos_extraidos_limpios): | |
| conceptos_busqueda = [ | |
| {'preferida': 'vigencia', 'alternativas': ['igencia', 'vigenca']}, | |
| ] | |
| indice, textos_extraidos_corregidos = herramientas.buscaIndexMultiplesPalabras(textos_extraidos_limpios, conceptos_busqueda) | |
| textos_extraidos_limpios = textos_extraidos_corregidos | |
| if indice is None: | |
| return None | |
| print("El índice de genero es: ", indice) | |
| texto = textos_extraidos_limpios[indice] | |
| vigencia = ine_antes_tools.obtener_vigencia(texto) | |
| if vigencia is not None: | |
| return vigencia | |
| else: | |
| return None |