From f20828ffd8ea9d554566636a9c53a3abd57507c5 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Sat, 18 Jul 2026 08:57:22 +0200 Subject: Classify line ends by alignment clusters and canonicalize definition lists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The percentile-based right-margin estimate from the previous commit misclassified two real-world layouts: at the column switch of the two-column old-BGBl format a window contains both column margins, so the 90th percentile returned the right column's margin and marked every left-column soft wrap as deliberate (vetoing hyphen mending, IfSG 2020: "Impf- surveillance"); and series of equally wide centered "Artikel N" headings in draft bills formed the top of their window's distribution, so they counted as full-width and were reflowed into the following line, breaking teileInArtikel's line anchor (ProdHaftG RegE). Classify against alignment clusters instead: a line end is soft when at least five window lines end within 4 pt of it (the justified block's own margin), hard when such a cluster runs at least 10 pt above it, unclassified otherwise. Structure anchors ("Artikel 2", "§ 19", bare Gliederung labels) are always exempt from reflow since equal-width heading series still form sham clusters. Also flush the pending line end-X at page ends — without it, the first line of the next page inherited the previous page's footer geometry and was misclassified (UWG: "Artikel 2" swallowed the closing provisions). Markerless joins additionally never cross into a following enumeration marker line ("...vorgesehen und" + "d) die Überwachung" no longer glues to "undd)"), a text-level veto that also works without geometry. On the base-law side, ContentFlattener now separates sibling elements within a
— the short-label/definition pairs of the UWG Anhang and § 2 IfSG were previously glued without any separator ("Irreführung über Unternehmereigenschaftdie unwahre Angabe...") in both synopsis columns. The continuation line is indented two spaces deeper than its enumeration line so StellenAufloeser.zeilenBlock keeps it inside the unit's block ("Anhang Nummer 31 Buchstabe b"). BefehlAnwender writes the same canonical shape when inserting or recasting quoted units (rueckeZitatEin), so XML-derived and PDF-derived items agree: " 2a. Stichwort" + " Definitionstext". Verified by mvnw verify (179 tests, 7 new) and a before/after sweep of all 21 sample law/amendment combinations: applied/manual counts are unchanged throughout (UWG 19/0, GEG-BGBl 66/53, GModG-RegE 77/20, IfSG-0645 42/24, ...), no marker characters leak into the HTML output. Co-Authored-By: Claude Fable 5 Change-Id: Ib7faae1bc5c59bda83f648a579af16a4c77e4285 --- src/test/resources/eu/mulk/aendggner/mini-gii.xml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/test/resources') diff --git a/src/test/resources/eu/mulk/aendggner/mini-gii.xml b/src/test/resources/eu/mulk/aendggner/mini-gii.xml index 866f81b..8ae0418 100644 --- a/src/test/resources/eu/mulk/aendggner/mini-gii.xml +++ b/src/test/resources/eu/mulk/aendggner/mini-gii.xml @@ -78,4 +78,18 @@ + + + TestG + Anhang + (zu § 1) + + + + +

1.
Irreführung über die Erprobungdie unwahre Angabe, die Erprobung sei abgeschlossen;
2.
Verheimlichung von Prüfschrittendas Verschweigen, dass
a)
Zwischenschritte oder
b)
Endschritte ausgelassen wurden.

+
+
+
+
-- cgit v1.2.1