Spaces:
Runtime error
Runtime error
| #Herramientas Generales | |
| def listaTextosExtraidos(result): | |
| textos_extraidos = [] | |
| print("Líneas encontradas con modelo IA:") | |
| for item in result: | |
| texto = item[1][0] | |
| print(texto) | |
| textos_extraidos.append(texto) | |
| return textos_extraidos | |
| #Herramientas para DNI Panamá. | |
| def buscaIndexPalabra(arreglo, palabra): | |
| palabra_limpia = palabra.lower().replace(" ", "") | |
| for i, texto_limpio in enumerate(arreglo): | |
| if palabra_limpia in texto_limpio: | |
| return i | |
| return 'error' | |
| def buscarPatronCedula(lista_textos): | |
| for i, texto in enumerate(lista_textos): | |
| if texto and texto[0].isdigit() and '-' in texto: | |
| return i | |
| return 'error' |