From d7f69f33697ec8a631c52ae656ff798559bdc304 Mon Sep 17 00:00:00 2001 From: Dario Kampkaspar Date: Thu, 29 Jun 2023 13:11:05 +0200 Subject: [PATCH 01/25] include tokenization by parameter --- page2tei-0.xsl | 17 ++++++++++++++++- simplify-coordinates.xsl | 6 +++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/page2tei-0.xsl b/page2tei-0.xsl index c989856..8cb4420 100644 --- a/page2tei-0.xsl +++ b/page2tei-0.xsl @@ -46,6 +46,7 @@ Whether to create bounding rectangles from polygons (default: true()) + Whether to export lines without baseline (true()) or not (false(), default) @@ -92,6 +93,10 @@ + + + + helper: gather page contents @@ -142,7 +147,17 @@ - + + + + + + + + + + + diff --git a/simplify-coordinates.xsl b/simplify-coordinates.xsl index cc84bdf..b037ed9 100644 --- a/simplify-coordinates.xsl +++ b/simplify-coordinates.xsl @@ -18,7 +18,7 @@ evaluate coordinates and return bounding rectangle - + @@ -73,9 +73,9 @@ Default - + - + From 18d4610a00fcd8ea6ef8ab55060ba1047554017c Mon Sep 17 00:00:00 2001 From: Dario Kampkaspar Date: Thu, 29 Jun 2023 13:18:50 +0200 Subject: [PATCH 02/25] improve node selectoin for continued rs also, do not add @break="no" to lb as this is not our job --- combine-continued.xsl | 30 ++++++++-- test/combine-continued-result.html | 60 ++++++++++++++++++-- test/combine-continued.xspec | 88 ++++++++++++++++++------------ 3 files changed, 132 insertions(+), 46 deletions(-) diff --git a/combine-continued.xsl b/combine-continued.xsl index ff46290..a77c767 100644 --- a/combine-continued.xsl +++ b/combine-continued.xsl @@ -16,17 +16,35 @@ - Combine continued rs + + Combine continued elements (e.g. rs) + This works on an element that contains (more than one) continued element (there may be just one element + if the continuation happens across region borders). + - + + group-starting-with="tei:*[ + @continued eq 'true' + and normalize-space() != '' + and (normalize-space(preceding::text()[1]) != '' or preceding::text()[1][not(preceding-sibling::*)]) + ]"> - + @@ -46,7 +64,7 @@ lb will be returned unaltered - + diff --git a/test/combine-continued-result.html b/test/combine-continued-result.html index 147dfd2..068c06e 100644 --- a/test/combine-continued-result.html +++ b/test/combine-continued-result.html @@ -1,7 +1,7 @@ - Test Report for /home/kampkaspar/git/page2tei/combine-continued.xsl (passed: 4 / pending: 0 / failed: 0 / total: 4) + Test Report for /home/kampkaspar/git/page2tei/combine-continued.xsl (passed: 6 / pending: 0 / failed: 0 / total: 6) + + +

Test Report

+

Stylesheet: /home/kampkaspar/git/page2tei/combine-hi.xsl

+

XSpec: /home/kampkaspar/git/page2tei/test/combine-hi.xspec

+

Tested: 18 July 2023 at 00:23

+

Contents

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
passed: 1pending: 0failed: 0total: 1
T11001
+
+

T1passed: 1 / pending: 0 / failed: 0 / total: 1

+ + + + + + + + + + + + + + + +
T1passed: 1 / pending: 0 / failed: 0 / total: 1
.Success
+
+ + \ No newline at end of file diff --git a/test/combine-hi.xspec b/test/combine-hi.xspec new file mode 100644 index 0000000..72641c9 --- /dev/null +++ b/test/combine-hi.xspec @@ -0,0 +1,24 @@ + + + + + +

+ Ich denke zu dem ersten Stück folgendes zu geben, wobey ich Euch + noch allerley um Rath zu fragen habe. Erstlich vier Briefe über W[il¬ + helm] M[eister], vielleicht auch nur drey37, nach Befinden der Um¬ + stände.

+
+ +

+ Ich denke zu dem ersten Stück folgendes zu geben, wobey ich Euch + noch allerley um Rath zu fragen habe. Erstlich vier Briefe über W[il¬ + helm] M[eister], vielleicht auch nur drey37, nach Befinden der Um¬ + stände.

+
+
+ +
From 67fe47ed8f1f5202a3a05229e67b13ee501ce63c Mon Sep 17 00:00:00 2001 From: Dario Kampkaspar Date: Tue, 18 Jul 2023 01:34:23 +0200 Subject: [PATCH 11/25] handle white space at end of group --- combine-hi.xsl | 10 ++++++++-- test/combine-hi-result.html | 34 ++++++++++++++++++++++++++++++---- test/combine-hi.xspec | 13 +++++++++++++ 3 files changed, 51 insertions(+), 6 deletions(-) diff --git a/combine-hi.xsl b/combine-hi.xsl index e59c0e0..f794cb8 100644 --- a/combine-hi.xsl +++ b/combine-hi.xsl @@ -15,8 +15,14 @@ - + + + + + + + @@ -27,7 +33,7 @@
- + diff --git a/test/combine-hi-result.html b/test/combine-hi-result.html index 9f3df90..326ced6 100644 --- a/test/combine-hi-result.html +++ b/test/combine-hi-result.html @@ -1,7 +1,7 @@ - Test Report for /home/kampkaspar/git/page2tei/combine-hi.xsl (passed: 1 / pending: 0 / failed: 0 / total: 1) + Test Report for /home/kampkaspar/git/page2tei/combine-hi.xsl (passed: 2 / pending: 0 / failed: 0 / total: 2)