static ReadingComprehensionTest ai_parseReadingComprehensionTest_v1(S text) { ReadingComprehensionTest test = nu(+text); LS paragraphs = pnlStruct(paragraphsTokC(text)); L isQ = print(map(rcurry_swic("Question"), paragraphs)); int idx = print(falsesFollowedByTrues_changeIndex_assertNotNull(isQ)); LS textPart = takeFirst(paragraphs, idx); LS questionsPart = sublist(paragraphs, idx); assertTrue(isPreciseMultiDashesHeading(first(textPart))); test.text = joinWithEmptyLines(dropFirst(textPart)); test.textSentences = pnl(sentences(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; }