def us11_no_bigamy(file): error_list = list() #printTables(file) indDict,famDict = parse_main(file) totalSpouses = [] numSpouse = 0 for iD in indDict: an_Indi = indDict[iD] if an_Indi.Spouse == 'NA': continue else: for famID in famDict: id_Fam = famDict[famID] if (famID != an_Indi.Spouse and ((id_Fam.Husband and an_Indi.indID == id_Fam.Husband) or (id_Fam.Wife and an_Indi.indID == id_Fam.Wife))): if (famDict[an_Indi.Spouse].Marriage and id_Fam.Marriage): if date_Check(famDict[an_Indi.Spouse].Marriage, id_Fam.Marriage): marriage1 = famDict[an_Indi.Spouse] marriage2 = id_Fam else: marriage1 = id_Fam marriage2 = famDict[an_Indi.Spouse] if(an_Indi.indID == marriage1.Husband): id_Spouse = marriage1.Wife else: id_Spouse = marriage1.Husband if (marriage1.Divorce == 'NA'): if(indDict[id_Spouse].Death == 'NA'): error_string = f"ERROR: INDIVIDUAL: US11: {an_Indi.indID}:Married2 {marriage1.famID} & {marriage2.famID}" error_list.append(error_string) else: if (date_Check(marriage2.Marriage, indDict[id_Spouse].Death)): error_string =f"ERROR: INDIVIDUAL: US11: {an_Indi.indID}:Married2 {marriage1.famID} & {marriage2.famID}" error_list.append(error_string) else: if (date_Check(marriage2.Marriage, marriage1.Divorce)): error_string = f"ERROR: INDIVIDUAL: US11: {an_Indi.indID}:Married2 {marriage1.famID} & {marriage2.famID}" error_list.append(error_string) return error_list
def us06_divo_b4_death(file): error_list = list() #printTables(file) indDict, famDict, errorList = parse_main(file) for famID in famDict: an_Indi = indDict[famDict[famID].Husband] an_Indi1 = indDict[famDict[famID].Wife] id_Fam = famDict[famID] if id_Fam.Marriage == 'NA': error_string = f"ANOMALY: FAMILY: US06: {id_Fam.famID}: Marriage date is not Found ! " error_list.append(error_string) elif an_Indi.Birthday == 'NA': error_string = f"ANOMALY: FAMILY: US06: {an_Indi.indID}: Birthday not Found ! " error_list.append(error_string) elif an_Indi1.Birthday == 'NA': error_string = f"ANOMALY: FAMILY: US06: {an_Indi1.indID}: Birthday not Found ! " error_list.append(error_string) elif an_Indi.Death == 'NA': continue elif an_Indi1.Death == 'NA': continue elif id_Fam.Divorce == 'NA': #error_string = f"ANOMALY: INDIVIDUAL: US06: {an_Indi.indID}: Divorce not Found ! " #error_list.append(error_string) continue else: finalOutput = date_Check(id_Fam.Divorce, an_Indi.Death) #print(an_Indi.Death) #print(an_Indi1.Death) finalOutput1 = date_Check(id_Fam.Divorce, an_Indi1.Death) if finalOutput == False: error_string = f"ERROR: FAMILY: US06: {id_Fam.famID} : Divorce {id_Fam.Divorce} is after death {an_Indi.Death}" error_list.append(error_string) if finalOutput1 == False: error_string = f"ERROR: FAMILY: US06: {id_Fam.famID} : Divorce {id_Fam.Divorce} is after death {an_Indi1.Death}" error_list.append(error_string) return error_list
def us03_birth_b4_death(file): error_list = list() #printTables(file) indDict, famDict, errorList = parse_main(file) for iD in indDict: an_Indi = indDict[iD] if an_Indi.Death == 'NA' and an_Indi.Birthday != 'NA': continue if an_Indi.Birthday == 'NA': error_string = f"ANOMALY: INDIVIDUAL: US03: {an_Indi.indID}: Birthdate not Found " error_list.append(error_string) else: finalOutput = date_Check(an_Indi.Birthday, an_Indi.Death) if finalOutput == False: error_string = f"ERROR: INDIVIDUAL: US03: {an_Indi.indID} : Died {an_Indi.Death} before born {an_Indi.Birthday} " error_list.append(error_string) return error_list