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

    Interface SegmentationRules

    A rule set knows how to spot question and answer headings in one document family.

    interface SegmentationRules {
        answer?: RegExp;
        answerFollowsQuestion?: boolean;
        bareNumbering?: boolean;
        description: string;
        key: string;
        onlyWhenUnmarked?: boolean;
        question: RegExp;
        subAnswer?: RegExp;
        subQuestion?: RegExp;
        unnumberedAnswer?: RegExp;
    }
    Index
    answer?: RegExp

    Matches an answer heading at the start of a line; group 1 is the number list. Absent for a family whose answers carry no heading — expressing that as "no pattern" rather than as a pattern that matches nothing, because a regex written to never match (/$^/) does in fact match an empty line.

    answerFollowsQuestion?: boolean

    This family has no answer heading at all: the answer simply follows the question. The split is made at the last line of the block that ends in a question mark — see splitAtQuestionMark.

    bareNumbering?: boolean

    True when this family's question headings are bare numbers (1.) rather than a keyword. Those need the sentence-continuation guard: a line beginning "101. Arbeits- und Sozialministerkonferenz" in the middle of a sentence is prose, not question 101, and reading it as one makes the whole document look misnumbered.

    description: string
    key: string
    onlyWhenUnmarked?: boolean

    Only believe this family when the text contains no answer headings anywhere. A family that infers where the answer starts must not be allowed to compete with one that can simply read it.

    question: RegExp

    Matches a question heading at the start of a line; group 1 is the number list.

    subAnswer?: RegExp

    Matches an answer heading that refers to a letter sub-item (Zu a)), resolved against the numbered question it sits under. Mecklenburg-Vorpommern asks 1. then a), b), c) and answers Zu a), Zu b).

    subQuestion?: RegExp

    Matches a letter-only sub-item (a., b)) that belongs to the numbered question above it; group 1 is the letter. Absent when the family has none.

    unnumberedAnswer?: RegExp

    Matches an answer heading that carries no number (Antwort:), which answers the question most recently seen. Schleswig-Holstein writes its answers this way, under numbered questions.