@maschinenlesbar.org/openka-cli
    Preparing search index...

    Function splitAtQuestionMark

    • Split a block into the question and the answer that follows it.

      Two steps, because documents mark the boundary in two different ways:

      1. By paragraph. The question is the leading paragraphs up to and including the last one containing a question mark; the rest is the answer. This is what NRW needs: its questions read "… zu gewinnen? (Bitte nach Maßnahmenart differenzieren)", so the question mark is not at the end of the question, and a line-based rule loses the whole answer.
      2. By line, when the block is a single paragraph: the question ends at the last line ending in a question mark. This is what the Bundestag needs, where the answer does not always start a new paragraph.

      The last question mark rather than the first, because a numbered item often asks several things. A block with no question mark at all is all question and the answer abstains — the honest reading of a question nobody answered.

      Parameters

      • body: string

      Returns { answer?: string; question: string }