isq=m.group(0) isq=isq.replace(isq[0],isq[0].lower()) isq=isq.replace(' is ',' ') questionarray.append('Is %s?' % (isq[0:len(isq)-1]))''' askfunc.removeQuestions(questionarray) for line in f: for m in re.finditer("[1-2]{0,1}[0-9]\s((January)|(February)|(March)|(April)|(May)|(June)|(July)|(August)|(September)|(October)|(November)|(December))\s([0-2][0-9][0-9][0-9])",line): if re.search("[1-2]{0,1}[0-9]\s((January)|(February)|(March)|(April)|(May)|(June)|(July)|(August)|(September)|(October)|(November)|(December))\s([0-2][0-9][0-9][0-9])",line): date=m.group(0) year=date[-4:] year=pronounce.pronounce_year(year) if re.match("[10-31]",date): day=date[:2] day='the '+pronounce.pronounce_day(day).lower()+' of' date=day+date[2:] else: day=date[0] day='the '+pronounce.pronounce_day(day)+' of' date=day+date[1:] day='the '+pronounce.pronounce_day(day)+' of' date=date[:-4]+year questionarray.append('What is the significance of %s?' %date) for m in re.finditer("((January)|(February)|(March)|(April)|(May)|(June)|(July)|(August)|(September)|(October)|(November)|(December)) [0-9]{1,2}, ([0-2][0-9][0-9][0-9])",line): if re.search("((January)|(February)|(March)|(April)|(May)|(June)|(July)|(August)|(September)|(October)|(November)|(December)) [0-9]{1,2}, ([0-2][0-9][0-9][0-9])",line): date=m.group(0) year=date[-4:] year=pronounce.pronounce_year(year) if re.match("[10-31]",date[-8:-6]): day=date[-8:-6]