static ReadingComprehensionTest ai_parseReadingComprehensionTest_v1(S rawText, O... _) { optPar bool printText = true; new ReadingComprehensionTest test; LS paragraphs = pnlStructIf(printText, paragraphsTokC(rawText)); L isQ = map(rcurry_swic("Question"), paragraphs); int idx = falsesFollowedByTrues_changeIndex_assertNotNull(isQ); LS textPart = takeFirst_clone(paragraphs, idx); LS questionsPart = sublist(paragraphs, idx); if (isPreciseMultiDashesHeading(first(textPart))) popFirst(textPart); test.text = joinWithEmptyLines(textPart); test.sentences = pnlIf(printText, sentences(test.text)); for (S s : questionsPart) { LS lines = tlft(s); assertEquals(4, l(lines)); assertStartsWith(first(lines), "Question "); S q = second(lines); LS answersOnLine = regexpGroups("^1(.+)2(.+)$", third(lines)); assertNempty(answersOnLine); LS answersOnLine2 = regexpGroups("^3(.+)4(.+)$", last(lines)); assertNempty(answersOnLine2); LS answers = trimAll(concatLists(answersOnLine, answersOnLine2)); add(test.questions, nu(ReadingComprehensionTest.Question.class, question := q, +answers)); print(q); printStruct(answers); } ret test; }