Commit 347968a3 authored by MRodz's avatar MRodz Committed by mrodzis
Browse files

Add first draft for 3.7 sketches

parent b1350c96
......@@ -60,6 +60,39 @@ declare
fontane-simple:transform($node)
};
(: 3.7 Sketches :)
declare
%test:name("Sketches")
%test:args("<zone xmlns=""http://www.tei-c.org/ns/1.0"" type=""illustration"" ulx=""0.6"" uly=""0.0"" lry=""10.9"" lrx=""9.6""><milestone xmlns=""http://www.tei-c.org/ns/1.0"" unit=""illustration""/><figure xmlns=""http://www.tei-c.org/ns/1.0"" xml:id=""a2""/><zone xmlns=""http://www.tei-c.org/ns/1.0"" ulx=""6.1"" uly=""0.8""><line xmlns=""http://www.tei-c.org/ns/1.0"">Dach</line></zone></zone>")
%test:assertEquals("<ab xmlns=""http://www.tei-c.org/ns/1.0"" type=""sketch""><figure xmlns=""http://www.tei-c.org/ns/1.0"" xml:id=""a2""/><seg xmlns=""http://www.tei-c.org/ns/1.0"" type=""caption"" rendition=""margin-left:6.1cm; margin-top:0.8cm"">Dach</seg></ab>")
%test:args("<zone xmlns=""http://www.tei-c.org/ns/1.0"" type=""illustration"" ulx=""1.4"" uly=""5.6"" lrx=""8.3"" lry=""15.5""><milestone xmlns=""http://www.tei-c.org/ns/1.0"" unit=""illustration""/><figure xmlns=""http://www.tei-c.org/ns/1.0"" xml:id=""a2""><figDesc xmlns=""http://www.tei-c.org/ns/1.0""><ref xmlns=""http://www.tei-c.org/ns/1.0"" target=""http://vocab.getty.edu/aat/300034065"">Gebäudeaufriss</ref>; Jagdschloss Stern.</figDesc></figure></zone>")
%test:assertEquals("<ab xmlns=""http://www.tei-c.org/ns/1.0"" type=""sketch""><figure xmlns=""http://www.tei-c.org/ns/1.0"" xml:id=""a2""/></ab>")
%test:args("<zone xmlns=""http://www.tei-c.org/ns/1.0""><zone xmlns=""http://www.tei-c.org/ns/1.0"" uly=""11.3"" lrx=""8.6"" lry=""11.8"" ><line xmlns=""http://www.tei-c.org/ns/1.0"" style=""margin-left:1.2cm"">Eimer in dieſer Form</line></zone><zone xmlns=""http://www.tei-c.org/ns/1.0"" type=""illustration"" ulx=""9.0"" uly=""11.0"" lrx=""10.6"" lry=""11.8""><figure xmlns=""http://www.tei-c.org/ns/1.0"" xml:id=""a2""><figDesc xmlns=""http://www.tei-c.org/ns/1.0""><ref xmlns=""http://www.tei-c.org/ns/1.0"" target=""http://vocab.getty.edu/aat/300124063"">Technische Illustration</ref></figDesc></figure></zone></zone>")
%test:assertEquals("Eimer in dieser Form", "<ab xmlns=""http://www.tei-c.org/ns/1.0"" type=""sketch""><figure xmlns=""http://www.tei-c.org/ns/1.0"" xml:id=""a2""/></ab>")
%test:args("<zone xmlns=""http://www.tei-c.org/ns/1.0"" type=""list"" subtype=""legend""><line xmlns=""http://www.tei-c.org/ns/1.0"" style=""margin-left:1.4cm"" type=""item""><seg xmlns=""http://www.tei-c.org/ns/1.0""><ref xmlns=""http://www.tei-c.org/ns/1.0"" target=""#C04_4v_3"">A. Kloſterkirche.</ref></seg></line><zone xmlns=""http://www.tei-c.org/ns/1.0"" type=""item""><line xmlns=""http://www.tei-c.org/ns/1.0"" style=""margin-left:1.4cm""><seg xmlns=""http://www.tei-c.org/ns/1.0""><ref xmlns=""http://www.tei-c.org/ns/1.0"" target=""#C04_4v_2 #C04_4v_4"">B. und C. Moderniſirte Kloſter-</ref></seg></line></zone></zone>")
%test:assertEquals("<list xmlns=""http://www.tei-c.org/ns/1.0"" subtype=""legend""><item xmlns=""http://www.tei-c.org/ns/1.0""><ref xmlns=""http://www.tei-c.org/ns/1.0"" target=""#C04_4v_3"">A. Klosterkirche.</ref></item><item xmlns=""http://www.tei-c.org/ns/1.0""><ref xmlns=""http://www.tei-c.org/ns/1.0"" target=""#C04_4v_2 #C04_4v_4"">B. und C. Modernisirte Kloster</ref></item></list>")
%test:args("<zone xmlns=""http://www.tei-c.org/ns/1.0"" type=""legend""><line xmlns=""http://www.tei-c.org/ns/1.0"" style=""margin-left:1.4cm""><seg xmlns=""http://www.tei-c.org/ns/1.0""><ref xmlns=""http://www.tei-c.org/ns/1.0"" target=""#C04_4v_3"">A. Kloſterkirche.</ref></seg></line></zone>")
%test:assertEquals("<div xmlns=""http://www.tei-c.org/ns/1.0"" type=""legend""><ref xmlns=""http://www.tei-c.org/ns/1.0"" target=""#C04_4v_3"">A. Klosterkirche.</ref></div>")
%test:args("<certainty xmlns=""http://www.tei-c.org/ns/1.0"" cert=""high"" target=""#C02_8v_1"" locus=""value""><desc xmlns=""http://www.tei-c.org/ns/1.0"" type=""edited_text"">Unsicherer Befund. Bei den Linien könnte es sich auch um Abgrenzungslinien handeln. Da allerdings kein Text angrenzt, wurde für eine Codierung als Skizze optiert.</desc></certainty>")
%test:assertEquals("<note xmlns=""http://www.tei-c.org/ns/1.0"" type=""editorial"" subtype=""certainty"" cert=""high"" target=""#C02_8v_1"">Unsicherer Befund. Bei den Linien könnte es sich auch um Abgrenzungslinien handeln. Da allerdings kein Text angrenzt, wurde für eine Codierung als Skizze optiert.</note>")
%test:args("<zone xmlns=""http://www.tei-c.org/ns/1.0"" type=""illustration"" style=""text-decoration:line-through"" rend=""line-through-style:zigzag"" ulx=""4.2"" uly=""9.0"" lrx=""7.1"" lry=""11.1""><del xmlns=""http://www.tei-c.org/ns/1.0""><figure xmlns=""http://www.tei-c.org/ns/1.0""/></del></zone>
")
%test:assertEmpty
%test:args("<zone xmlns=""http://www.tei-c.org/ns/1.0"" type=""illustration""><milestone xmlns=""http://www.tei-c.org/ns/1.0"" unit=""illustration""/><zone xmlns=""http://www.tei-c.org/ns/1.0"" type=""illustration"" ulx=""0.8"" uly=""0.0"" lrx=""5.9"" lry=""7.6""><figure xml:id=""a4"" xmlns=""http://www.tei-c.org/ns/1.0""><figDesc xmlns=""http://www.tei-c.org/ns/1.0"" copyOf=""#C08_16r_a""/></figure></zone><zone xmlns=""http://www.tei-c.org/ns/1.0"" type=""illustration"" ulx=""6.9"" uly=""1.1"" lrx=""8.5"" lry=""3.8""><figure xmlns=""http://www.tei-c.org/ns/1.0"" xml:id=""a5""><figDesc xmlns=""http://www.tei-c.org/ns/1.0"" xml:id=""C08_16r_a""><ref xmlns=""http://www.tei-c.org/ns/1.0"" target=""http://vocab.getty.edu/aat/300015566"">Umgebungsplan</ref> Venedig mit Markusplatz, San Giorgio Maggiore und La Giudecca</figDesc></figure></zone></zone>")
%test:assertEquals("<ab xmlns=""http://www.tei-c.org/ns/1.0"" type=""composed-sketch""><ab rendition=""margin-left:0.8cm; margin-top:0.0cm"" xmlns=""http://www.tei-c.org/ns/1.0"" type=""sketch""><figure xmlns=""http://www.tei-c.org/ns/1.0"" xml:id=""a4""/></ab><ab xmlns=""http://www.tei-c.org/ns/1.0"" type=""sketch"" rendition=""margin-left:6.9cm; margin-top:1.1cm""><figure xmlns=""http://www.tei-c.org/ns/1.0"" xml:id=""a5""/></ab></ab>")
function teisimple-test:analyze-sketches($node as element(*)) {
fontane-simple:transform($node)
};
(: 3.8.1 Line counting :)
declare
......
......@@ -267,6 +267,12 @@ declare function fontane-simple:transform($nodes as node()*) as node()* {
}
else
()
case element(tei:milestone) return
if($node/@unit = "illustration") then
()
else
fontane-simple:transform($node/node())
case element(tei:gap) return
local:keep-element($node)
......@@ -322,7 +328,42 @@ declare function fontane-simple:transform($nodes as node()*) as node()* {
element tei:hi {
attribute type {"vertical-mark"},
fontane-simple:transform($node/node())
}
}
else if($node/@type = "illustration") then
if(not($node//tei:figure/parent::tei:del)) then
element {QName("http://www.tei-c.org/ns/1.0", "ab")}{
(if($node/child::tei:zone[@type = "illustration"]) then
attribute type {"composed-sketch"}
else
(attribute type {"sketch"},
if($node/parent::tei:zone[@type = "illustration"]) then
attribute rendition {"margin-left:" || $node/@ulx
|| "cm; " || "margin-top:" || $node/@uly || "cm"}
else
()
)
),
fontane-simple:transform($node/node())
}
else
()
else if($node/parent::tei:zone/@type = "illustration") then
element {QName("http://www.tei-c.org/ns/1.0", "seg")}{
attribute type {"caption"},
attribute rendition {"margin-left:" || $node/@ulx || "cm; "
|| "margin-top:" || $node/@uly || "cm"},
fontane-simple:transform($node/node())
}
else if($node/@type = "list" or $node/@type = "item") then
element {QName("http://www.tei-c.org/ns/1.0", $node/@type)}{
$node/(@* except @type),
fontane-simple:transform($node/node())
}
else if($node/@type = "legend") then
element {QName("http://www.tei-c.org/ns/1.0", "div")}{
$node/@*,
fontane-simple:transform($node/node())
}
else if(not($node/@xml:id)) then
fontane-simple:transform($node/node())
else if($node/@xml:id and fontane-simple:is-transposed($node)) then
......@@ -368,10 +409,14 @@ declare function fontane-simple:transform($nodes as node()*) as node()* {
else
attribute type {"short-paragraph-line"}
}
else
()
else if($node/parent::tei:zone[@type = "illustration"]) then
element {QName("http://www.tei-c.org/ns/1.0", $node/name())}{
$node/@*
}
else
local:keep-element($node)
()
else
local:keep-element($node)
case element(tei:note) return
if($node/@type = "authorial"
......@@ -379,6 +424,15 @@ declare function fontane-simple:transform($nodes as node()*) as node()* {
()
else
local:keep-element($node)
case element(tei:certainty) return
element {QName("http://www.tei-c.org/ns/1.0", "note")}{
attribute type {"editorial"},
attribute subtype {"certainty"},
$node/@cert,
$node/@target,
fontane-simple:transform($node/node())
}
case element(tei:figDesc) return
local:keep-element($node)
......
......@@ -547,7 +547,7 @@
<item rend="align(center)">
<seg rendition="letter-spacing:0.2cm; font-size:large">(
......@@ -582,7 +582,7 @@
<expan>et cetera</expan>
</choice> etc.
<handShift medium="pencil" script="Latf"/>
</item>
</tei:div>
......@@ -615,7 +615,7 @@
<item rend="align(center)">
<seg rendition="letter-spacing:0.2cm; font-size:large">(
......@@ -650,7 +650,7 @@
<expan>et cetera</expan>
</choice> etc.
<handShift medium="pencil" script="Latf"/>
</item>
</tei:div>
......@@ -701,8 +701,8 @@
<handShift script="Latf"/>
<list xml:id="C07_1r_5" next="#C07_2r_2">
<item uly="2.7" lry="4.1">
1.
Johannes<seg rendition="letter-spacing:0.2cm"> <hi>
......@@ -721,7 +721,7 @@
1496
</item>
2.
Luther
......@@ -735,7 +735,7 @@
<item>
3. Schulbesuch in
<hi>Eisenach</hi>
......@@ -745,8 +745,8 @@
Wahrscheinlich bis 1501
.
</item>
<item>
4. Weitrer Schulbesuch
in
......@@ -761,8 +761,8 @@
von 1501 bis 1505
.
</item>
<item>
5.
Luther
tritt als Mönch
......@@ -792,9 +792,9 @@
glaube bis 1508
.
</item>
</list>
......@@ -807,7 +807,7 @@
<item xml:id="C07_1r_13" prev="#C07_1r_q" next="#C07_1r_14" ulx="2.4" uly="5.5" lry="5.9">
<handShift medium="brown_ink thin_pen"/>
Ein Stück seines Mantels und sei
......@@ -820,10 +820,10 @@
Petri⸗Paul</hi>-Kirche
.
<handShift medium="pencil"/>
</item>
<anchor xml:id="C07_1r_s"/>
<item xml:id="C07_1r_14" prev="#C07_1r_13" next="#C07_1r_8" rotate="90" ulx="1.4" uly="3.8">
<handShift medium="brown_ink thin_pen"/>
Sein <hi>Chormantel</hi> in der
Bibliothek zu <handShift script="Latn"/>Weimar
......@@ -848,14 +848,14 @@
Salzungen
.
<handShift medium="pencil" script="standard"/>
</item>
<anchor xml:id="C07_1r_r"/>
</tei:div>
<pb n="1v"/>
<tei:div xmlns:tei="http://www.tei-c.org/ns/1.0" type="page">
<item xml:id="C07_1v_1" prev="#C07_2r_3" next="#C07_2r_4" uly="1.8" lry="7.2">
<handShift script="clean"/>
<tei:ab type="caret"></tei:ab>
......@@ -905,7 +905,7 @@
<handShift script="standard"/>
</item>
<anchor xml:id="C07_1v_a"/>
</tei:div>
<pb n="2r"/>
......@@ -917,9 +917,9 @@
<handShift new="#Fontane" script="clean"/>
<list xml:id="C07_2r_2" prev="#C07_1r_5" next="#C07_3r_2">
<item xml:id="C07_2r_3" next="#C07_1v_1" uly="1.2" lry="2.8">
6.
<hi>
......@@ -932,9 +932,9 @@
</item>
<item>
7.
1517
......@@ -946,9 +946,9 @@
Wittenberg</hi>
.
</item>
<item uly="5.9">
8.
1521
......@@ -956,8 +956,8 @@
<hi>Worms</hi>
.
</item>
<item xml:id="C07_2r_5" uly="7.2" lry="11.0">
9.
Vom 4. Mai 1521 bis
......@@ -979,18 +979,18 @@
senach
.
</item>
<item uly="11.6">
10.
<hi>Wittenberg</hi>
</item>
<item uly="12.7" lry="16.4">
11.
1530 (vom 16. April
......@@ -1018,11 +1018,11 @@
ist unser Gott.“
</item>
</list>
<item xml:id="C07_2r_7" prev="#C07_2r_5" next="#C07_2r_6" ulx="5.6" uly="10.4" lry="11.7">
<handShift medium="brown_ink thin_pen"/>
An der „
Lutherbuche
......@@ -1038,7 +1038,7 @@
auf
gehoben.
<handShift medium="pencil" script="standard"/>
</item>
<anchor xml:id="C07_2r_q"/>
</tei:div>
......@@ -1054,8 +1054,8 @@
<handShift new="#Fontane"/>
<list xml:id="C07_3r_2" prev="#C07_2r_2">
<item>
<handShift script="clean"/>
12. Die
Convente in
......@@ -1121,9 +1121,9 @@
geschlossen.
<handShift script="standard"/>
</item>
<anchor xml:id="C07_3r_s"/>
</list>
......@@ -1659,7 +1659,7 @@
</hi> umfassen
die eigentliche thüringische
Geschichte, in die
<list rend="indent">
<tei:item>
Ludwig der <hi>Springer</hi>
......@@ -1677,7 +1677,7 @@
Milde</hi>
,</tei:item>
<item>
Ludwig der <hi>Heilige
......@@ -1693,7 +1693,7 @@
</choice> Elisabeth
) und
</item>
<tei:item>
Heinrich <handShift script="Latn"/>Raspe<handShift script="Latf"/>
......@@ -1701,7 +1701,7 @@
. †
1247
.</tei:item>
</list>
<handShift script="standard"/>
</tei:div>
......@@ -1940,8 +1940,8 @@
Landgrafen
</hi>
<list>
<item>
die
1. Gruppe
......@@ -1952,8 +1952,8 @@
bis 1247
und
</item>
<item>
die
2. Gruppe
......@@ -1964,8 +1964,8 @@
bis 1440
.
</item>
</list>
Die <hi>
erste
</hi> Gruppe
......@@ -2857,14 +2857,14 @@
<ab type="sketch">
<seg type="caption" rendition="margin-left:4.8cm; margin-top:1.5cm">
<handShift script="Latn"/>
......@@ -2872,8 +2872,8 @@
<handShift script="Latf"/>
</seg>
<seg type="caption" rendition="margin-left:0.2cm; margin-top:5.7cm">
<handShift script="Latn"/>
......@@ -2881,8 +2881,8 @@
<handShift script="Latf"/>
</seg>
<seg type="caption" rendition="margin-left:2.1cm; margin-top:4.6cm">
<handShift script="Latn"/>
......@@ -2895,8 +2895,8 @@
<handShift script="Latf"/>
</seg>
<seg type="caption" rendition="margin-left:4.9cm; margin-top:4.5cm">
<handShift script="Latn"/>
......@@ -2909,8 +2909,8 @@
<handShift script="Latf"/>
</seg>
<seg type="caption" rendition="margin-left:5.4cm; margin-top:5.1cm">
<handShift script="Latn"/>
......@@ -2918,8 +2918,8 @@
<handShift script="Latf"/>
</seg>
<seg type="caption" rendition="margin-left:5.8cm; margin-top:5.4cm">
<handShift script="Latn"/>
......@@ -2927,8 +2927,8 @@
<handShift script="Latf"/>
</seg>
<seg type="caption" rendition="margin-left:6.2cm; margin-top:5.8cm">
<handShift script="Latn"/>
......@@ -2936,8 +2936,8 @@
<handShift script="Latf"/>
</seg>
<seg type="caption" rendition="margin-left:9.5cm; margin-top:6.9cm">
<handShift script="Latn"/>
......@@ -2945,24 +2945,24 @@
<handShift script="Latf"/>
</seg>
<seg type="caption" rendition="margin-left:5.6cm; margin-top:8.1cm">
<handShift script="Latn"/>
A.
<handShift script="Latf"/>
</seg>
<seg type="caption" rendition="margin-left:6.2cm; margin-top:7.0cm">
<handShift script="Latn"/>
B
<handShift script="Latf"/>
</seg>
<seg type="caption" rendition="margin-left:8.1cm; margin-top:7.3cm">
<handShift script="Latn"/>
C
<handShift script="Latf"/>
</seg>
</ab>
<list subtype="legend" uly="9.6" lry="11.7">
<handShift script="Latn"/>
<tei:item>
......@@ -2988,7 +2988,7 @@
<handShift script="Latn"/>Soult<handShift script="Latf"/>
.</tei:item>
</list>
<handShift script="Latn"/>
......@@ -2999,7 +2999,7 @@
im Centrum; die beiden andern
Corps souteniren
<list uly="15.0" lry="17.0">
<handShift script="Latn"/>
<tei:item>
......@@ -3018,7 +3018,7 @@
nach
Kapellendorf
.</tei:item>
<item>
<handShift script="Latn"/>
......@@ -3032,10 +3032,10 @@
grafenberg
.
</item>
<handShift script="standard"/>
<anchor xml:id="C07_60v_s"/>
</list>
</tei:div>
<pb n="61r"/>
<tei:div xmlns:tei="http://www.tei-c.org/ns/1.0" type="page">
......@@ -3055,7 +3055,7 @@
<handShift new="#Fontane"/>
<ab type="sketch">
......@@ -3063,15 +3063,15 @@
<handShift script="Latn"/>
<seg type="caption" rendition="margin-left:1.0cm; margin-top:4.9cm">
Eckartsberga
<handShift script="Latf"/>
</seg>
<seg type="caption" rendition="margin-left:1.9cm; margin-top:4.6cm">
<handShift script="Latn"/>
......@@ -3079,8 +3079,8 @@
<handShift script="Latf"/>
</seg>
<seg type="caption" rendition="margin-left:2.8cm; margin-top:4.9cm">