From 1c906fb186517f6ea85b3cb1f0a9fb54c1c2c314 Mon Sep 17 00:00:00 2001 From: Carsten Milling Date: Sun, 12 Jul 2026 17:21:03 +0200 Subject: [PATCH] Add Schematron check for antilabe @part sequence Verify that elements form a valid antilabe sequence: part="I" must be followed by part="M" or part="F"; part="M" must be preceded by part="I" or part="M" and followed by part="M" or part="F"; part="F" must be preceded by part="I" or part="M". Adapted from the schematron by @daliboris in https://github.com/daliboris/plays-encoding-framework, reimplemented with plain XPath 2.0 to match DraCor's existing constraint style. Closes #191 --- dracor.odd | 35 ++++++++ tests/tst000026-antilabe-part.xml | 134 ++++++++++++++++++++++++++++++ 2 files changed, 169 insertions(+) create mode 100644 tests/tst000026-antilabe-part.xml diff --git a/dracor.odd b/dracor.odd index 1d79f76..a55ab76 100644 --- a/dracor.odd +++ b/dracor.odd @@ -5229,6 +5229,41 @@ + + + Consecutive verse lines encoded with part represent + an antilabe, i.e. a verse line shared between speakers. The + values must form a valid sequence: I is followed by + M or F; M is preceded by + I or M and followed by M or + F; F is preceded by I or + M. + + + + + A verse line with part="I" (initial part of an antilabe) + must be followed by a verse line with part="M" or part="F". + + + + + A verse line with part="M" (medial part of an antilabe) + must be preceded by a verse line with part="I" or part="M". + + + A verse line with part="M" (medial part of an antilabe) + must be followed by a verse line with part="M" or part="F". + + + + + A verse line with part="F" (final part of an antilabe) + must be preceded by a verse line with part="I" or part="M". + + + + diff --git a/tests/tst000026-antilabe-part.xml b/tests/tst000026-antilabe-part.xml new file mode 100644 index 0000000..c56354e --- /dev/null +++ b/tests/tst000026-antilabe-part.xml @@ -0,0 +1,134 @@ + + + + + + + Ham + A Tragedy + William S + + + DraCor + https://dracor.org + + CC0 1.0 + + + + + + dracor-schema GitHub Repository + + + CC BY 4.0 + + + + Test fixture for antilabe @part sequence checks. + + + + + + + + + + + + + + + + Ham + + + Egg + + + Sausage + + + Bacon + + + + + + Test fixture for antilabe part sequence. + + + + +
+ Ham, a tragedy By William S +
+ + Dramatis Personae + Ham + Egg + + Sausage + Bacon + Vikings + + +
+ +
+ Act 1. +
+ Scene 1: I followed by non-part (invalid). + + Ham. + Half a line begun, + + + Egg. + but never finished properly. + +
+
+ Scene 2: F not preceded by I or M (invalid). + + Ham. + A normal line. + + + Egg. + This claims to be a final part. + +
+
+ Scene 3: M not preceded by I or M (invalid). + + Sausage. + A normal line. + + + Bacon. + This claims to be a medial part. + And a final part follows. + +
+
+ Scene 4: valid antilabe (must pass). + + Ham. + Speak, speak, + + + Egg. + and speak, + + + Sausage. + and be still. + +
+
+ +
+