def filter_notes(ns,english_only=True,min_length=3): assert type(ns[0]) == Note, "requires Notes not Note Values" from content_analysis import q from jv3.study.study import GLOBAL_STOP stop_owner = [x for x in User.objects.filter(email__in=GLOBAL_STOP)] return [x for x in ns if x.owner not in stop_owner and x.contents and len(x.contents.strip()) >= min_length and # note is non blank int(x.jid) >= 0 and # jid is not magic note q(english_only, is_english(x.contents), True) and # english if english only not is_tutorial_note(x.contents) and # not a tutorial not is_study1_note_contents(x.contents) # not a study1 note ]
def filter_notes(ns, english_only=True, min_length=3): assert type(ns[0]) == Note, "requires Notes not Note Values" from content_analysis import q from jv3.study.study import GLOBAL_STOP stop_owner = [x for x in User.objects.filter(email__in=GLOBAL_STOP)] return [ x for x in ns if x.owner not in stop_owner and x.contents and len(x.contents.strip()) >= min_length and # note is non blank int(x.jid) >= 0 and # jid is not magic note q(english_only, is_english(x.contents), True) and # english if english only not is_tutorial_note(x.contents) and # not a tutorial not is_study1_note_contents(x.contents) # not a study1 note ]
def spreadsheet_fill_in_blanks(sheet, with_what=0): from content_analysis import q new_sheet = [[q(c == '', with_what, c) for c in row] for row in sheet[1:]] return [sheet[0]] + new_sheet
def spreadsheet_fill_in_blanks(sheet,with_what=0): from content_analysis import q new_sheet = [ [ q(c == '', with_what, c) for c in row ] for row in sheet[1:] ] return [sheet[0]] + new_sheet