def process(x): baseType = checkBaseType(x) semanticType = "Name of NYCHA" if x == "": return (x, "{}\t{}\tNULL".format(baseType, semanticType)) else: return (x, "{}\t{}\tValid".format(baseType, semanticType))
def process(x): baseType = checkBaseType(x) semanticType = "Description_of_Offense" if x == "": return (x, "{}\t{}\tNULL".format(baseType, semanticType)) else: return (x, "{}\t{}\tValid".format(baseType, semanticType))
def process(x): baseType = checkBaseType(x) semanticType = "Premises description" if x == "": return (x, "{}\t{}\tNULL".format(baseType, semanticType)) else : return (x, "{}\t{}\tValid".format(baseType, semanticType))
def process(x): baseType = checkBaseType(x) semanticType = "Description_of_Internal_Classification" if x == "": return (x, "{}\t{}\tNULL".format(baseType, semanticType)) else: return (x, "{}\t{}\tValid".format(baseType, semanticType))
def process(x): baseType = checkBaseType(x) semanticType = "Indicator_of_Crime_Completion" if x == "": return (x, "{}\t{}\tNULL".format(baseType, semanticType)) elif x.upper() in range: return (x, "{}\t{}\tValid".format(baseType, semanticType)) else: return (x, "{}\t{}\tInvalid".format(baseType, semanticType))
def process(x): baseType = checkBaseType(x) semanticType = "Level_of_Offense" if x == "": return (x, "{}\t{}\tNULL".format(baseType, semanticType)) elif x.upper() in range: return (x, "{}\t{}\tValid".format(baseType, semanticType)) else: return (x, "{}\t{}\tInvalid".format(baseType, semanticType))
def process(x): baseType = checkBaseType(x[0]) semanticType = "Complaint_Num" if x[0] == "": return (x[0], "{}\t{}\tNULL".format(baseType, semanticType)) elif (x[0] not in counts): return (x[0], "{}\t{}\tValid".format(baseType, semanticType)) else: return (x[0], "{}\t{}\tInvalid".format(baseType, semanticType))
def process(x): baseType = checkBaseType(x) semanticType = "Specific location of occurrence" if x == "": return (x, "{}\t{}\tNULL".format(baseType, semanticType)) elif x.upper() in location: return (x, "{}\t{}\tValid".format(baseType, semanticType)) else: return (x, "{}\t{}\tInvalid".format(baseType, semanticType))
def process(x): baseType = checkBaseType(x) semanticType = "precinct number" if x == "": return (x, "{}\t{}\tNULL".format(baseType, semanticType)) elif re.match(r"^\d{1,3}$", x): return (x, "{}\t{}\tValid".format(baseType, semanticType)) else: return (x, "{}\t{}\tInvalid".format(baseType, semanticType))
def process(x): baseType = checkBaseType(x) semanticType = "Jurisdiction name" if x == "": return (x, "{}\t{}\tNULL".format(baseType, semanticType)) elif re.match(r"^.{5,30}$", x) : return (x, "{}\t{}\tValid".format(baseType, semanticType)) else : return (x, "{}\t{}\tInvalid".format(baseType, semanticType))
def process(x): baseType = checkBaseType(x) semanticType = "Name of borough" if x == "": return (x, "{}\t{}\tNULL".format(baseType, semanticType)) elif x.upper() in area: return (x, "{}\t{}\tValid".format(baseType, semanticType)) else: return (x, "{}\t{}\tInvalid".format(baseType, semanticType))
def process(x): data = x[3].strip() baseType = checkBaseType(data) semanticType = "Complaint_Ending_Date" if data == "": return (data, "{}\t{}\tNULL".format(baseType, semanticType)) elif ifIsNotValidDateString(data): return (data, "{}\t{}\tInvalid".format(baseType, semanticType)) else: return (data, "{}\t{}\tValid".format(baseType, semanticType))
def process(x): data = x[8].strip() baseType = checkBaseType(data) semanticType = "Three_Digit_Internal_Classification_Code" if data == "": return (data, "{}\t{}\tNULL".format(baseType, semanticType)) elif ifNotValidThreeDigitString(data): return (data, "{}\t{}\tInvalid".format(baseType, semanticType)) else: return (data, "{}\t{}\tValid".format(baseType, semanticType))
def process(x): data = x[5].strip() baseType = checkBaseType(data) semanticType = "Three_Digit_Offense_Classification_Code" if data == "": return (data, "{}\t{}\tNULL".format(baseType, semanticType)) elif ifIsNotValidDateString(data): return (data, "{}\t{}\tInvalid".format(baseType, semanticType)) else: return (data, "{}\t{}\tValid".format(baseType, semanticType))