this repo has no description

chore: New converter functionality backup

Signed-off-by: Sona Tau Estrada Rivera <sona@stau.space>

+2 -28
+2 -28
survey-questions/text/converter.py
··· 41 41 42 42 def file_data(filename: str): 43 43 file = open(filename) 44 - last_line = "" 45 - pages = [] 46 44 data = [] 47 - page_num = 0 48 45 for line in file: 49 - last_line = line 50 46 if len(line) == 1: 51 47 continue 52 - if filename.startswith("ipeds"): 53 - if page_num == 0: 54 - if line.startswith("https"): 55 - page_num = 1 56 - continue 57 - elif page_num == -1: 58 - continue 59 - elif line.startswith("https"): 60 - pages.append(data.copy()) 61 - data = [] 62 - page_num += 1 63 - elif line.startswith("Purpose of"): 64 - page_num = -1 65 - else: 66 - data.append(line) 67 - elif filename.startswith("AMS"): 68 - log("Cannot process AMS files", "fatal") 69 - exit(1) 70 - elif filename.startswith("cbms"): 71 - for line in file: 72 - data.append(line) 73 - pages = [data] 74 - data.append(last_line) 48 + data.append(line) 75 49 file.close() 76 - return pages 50 + return [data] 77 51 78 52 def process(pages: list[list[str]], intermediate: str) -> set[list[str]]: 79 53 current_question = ""