/* input e.g. [[ Inputs: "Where is the code repository?" "Where is the fork?" Expected output: "Where is the *?" ]] */ static SS parseColonHeadingSections(S text) { LS lines = lines(text); L l = indicesOfEndingWithTrim(lines, ":"); new LinkedHashMap out; if (nempty(l)) mapPutIfNemptyValue(out, "", rtrim(lines(takeFirst(lines, first(l))))); for i over l: { int i1 = get(l, i); int i2 = or(get(l, i+1), l(lines)+1); S heading = dropSuffix(":", trim(lines.get(i1))); out.put(heading, lines(subList(lines, i1+1, i2))); } ret out; }