Commit 5bc995df authored by MRodz's avatar MRodz Committed by mrodzis
Browse files

Add first draft for 3.21.16 multiphrases. test for interlinear leads to problems.

parent 47a960cb
......@@ -469,4 +469,25 @@ declare
%test:assertEquals("junge „wenn ic", "k")
function teisimple-test:analyze-added-above($node as element(*)) {
fontane-simple:transform($node)
};
(: 3.21.16 Multiphrases :)
declare
%test:name("Multiphrases")
(: this test results in an error:
java:org.exist.xquery.XPathException" message="exerr:ERROR The actual return type does not match the sequence type declared in the function's signature: test:equals(item(), item()) xs:boolean. Expected cardinality: exactly one, got 0.
reason unclear since a test with an XML yielded the desired output :)
(: %test:args("<line xmlns=""http://www.tei-c.org/ns/1.0""><seg xmlns=""http://www.tei-c.org/ns/1.0"" type=""multiphrase"" xml:id=""B02_78v_a"" corresp=""#B02_78v_b"">an<anchor xmlns=""http://www.tei-c.org/ns/1.0"" xml:id=""B02_78v_c""/>geſehenſten</seg> <add xmlns=""http://www.tei-c.org/ns/1.0"" corresp=""#B02_78v_c"" place=""above""><seg xmlns=""http://www.tei-c.org/ns/1.0"" type=""multiphrase"" xml:id=""B02_78v_b"" corresp=""#B02_78v_a"">vornehmſten</seg></add> Financiers</line>"):)
(: %test:assertEquals("<seg xmlns=""http://www.tei-c.org/ns/1.0"" type=""multiphrase"" xml:id=""B02_78v_a"" corresp=""#B02_78v_b"">an<anchor xmlns=""http://www.tei-c.org/ns/1.0"" xml:id=""B02_78v_c""/>geſehenſten</seg>", " ", "<add xmlns=""http://www.tei-c.org/ns/1.0"" corresp=""#B02_78v_c"" place=""above""><seg type=""multiphrase"" xml:id=""B02_78v_b"" corresp=""#B02_78v_a"">vornehmſten</seg></add>", " Financiers"):)
%test:args("<addSpan xmlns=""http://www.tei-c.org/ns/1.0"" type=""multiphrase"" subtype=""extensive"" xml:id=""D04_10r_c"" corresp=""#D04_10r_2"" spanTo=""#D04_10r_a"" place=""margin""/>")
%test:assertEmpty
%test:args("<zone type=""multiphrase"" subtype=""extensive"" xml:id=""D04_10r_2"" next=""#D04_10v_a"" corresp=""#D04_10r_c""><zone style=""border-left-style:solid""><line>mit einem ſlaviſch⸗ſtubs-</line></zone></zone>")
%test:assertEquals("mit einem ſlaviſch⸗ſtubs-")
function teisimple-test:analyze-multiphrase($node as element(*)) {
fontane-simple:transform($node)
};
\ No newline at end of file
......@@ -103,13 +103,16 @@ declare function fontane-simple:transform($nodes as node()*) as node()* {
fontane-simple:transform($node/node())
case element(tei:add) return
if($node/@type = "edited_text") then
$node
if($node/@type = "edited_text"
or $node/child::tei:seg[@type = "multiphrase"]) then
element tei:add {
$node/@*,
fontane-simple:transform($node/node())
}
else if(not($node/@xml:id)) then
fontane-simple:transform($node/node())
else if(fontane-simple:is-transposed($node)) then
let $corresp := //tei:metamark[matches(@target, $node/@xml:id)]
let $bla := console:log($corresp)
return
(fontane-simple:transform($corresp/node()),
fontane-simple:transform($node/node()))
......@@ -172,8 +175,8 @@ declare function fontane-simple:transform($nodes as node()*) as node()* {
if(count($node/*) = 1 and $node/child::tei:stamp)
then
()
else if($node/@type = "initials" or $node/@type = "monogram" or
$node/@style)
else if($node/@type = "initials" or $node/@type = "monogram"
or $node/@style or $node/@type = "multiphrase")
then
element tei:seg {
$node/@*,
......@@ -183,8 +186,11 @@ declare function fontane-simple:transform($nodes as node()*) as node()* {
or $node/@type = "cancel")
then
()
else
fontane-simple:transform($node/node())
else
fontane-simple:transform($node/node())
case element(tei:anchor) return
$node
case element(tei:surface)
return
......@@ -348,7 +354,6 @@ declare function fontane-simple:transform($nodes as node()*) as node()* {
let $target-id := substring-after($node/@target, "#")
let $target := $node/ancestor::tei:TEI//*[matches(@xml:id, $target-id)]
let $stripped-target := fontane-simple:strip-element($target)
let $stripped := console:log($stripped-target)
return fontane-simple:transform($stripped-target)
default return
fontane-simple:transform($node/node())
......
......@@ -823,7 +823,7 @@
.
<tei:handShift medium="pencil"/>
<anchor xml:id="C07_1r_s"/>
<tei:handShift medium="brown_ink thin_pen"/>
......@@ -851,7 +851,7 @@
.
<tei:handShift medium="pencil" script="standard"/>
<anchor xml:id="C07_1r_r"/>
</tei:div>
<tei:pb xmlns:tei="http://www.tei-c.org/ns/1.0" n="1v" facs="http://textgridrep.org/textgrid:164d9"/>
<tei:div xmlns:tei="http://www.tei-c.org/ns/1.0" type="page">
......@@ -908,7 +908,7 @@
<tei:handShift script="standard"/>
<anchor xml:id="C07_1v_a"/>
</tei:div>
<tei:pb xmlns:tei="http://www.tei-c.org/ns/1.0" n="2r" facs="http://textgridrep.org/textgrid:164d9"/>
<tei:div xmlns:tei="http://www.tei-c.org/ns/1.0" type="page">
......@@ -1041,7 +1041,7 @@
gehoben.
<tei:handShift medium="pencil" script="standard"/>
<anchor xml:id="C07_2r_q"/>
</tei:div>
<tei:pb xmlns:tei="http://www.tei-c.org/ns/1.0" n="2v" facs="http://textgridrep.org/textgrid:164f5"/>
......@@ -1124,7 +1124,7 @@
geſchloſſen.
<tei:handShift script="standard"/>
<anchor xml:id="C07_3r_s"/>
......@@ -1155,7 +1155,7 @@
.</tei:seg>
<tei:handShift script="Latf standard"/>
<anchor xml:id="C07_4r_s"/>
</tei:div>
<tei:pb xmlns:tei="http://www.tei-c.org/ns/1.0" n="4v" facs="http://textgridrep.org/textgrid:164g8"/>
......@@ -2207,7 +2207,7 @@
führte.)
<tei:handShift script="standard"/>
<anchor xml:id="C07_15r_s"/>
</tei:div>
<tei:pb xmlns:tei="http://www.tei-c.org/ns/1.0" n="15v" facs="http://textgridrep.org/textgrid:164dt"/>
......@@ -3036,7 +3036,7 @@
.
<tei:handShift script="standard"/>
<anchor xml:id="C07_60v_s"/>
</tei:div>
<tei:pb xmlns:tei="http://www.tei-c.org/ns/1.0" n="61r" facs="http://textgridrep.org/textgrid:164hd"/>
......@@ -3189,9 +3189,9 @@
weitig geſchah war unbedeutend.
<tei:handShift script="standard"/>
<anchor xml:id="C07_61r_s"/>
<anchor xml:id="C07_61r_2a"/>
</tei:div>
<tei:pb xmlns:tei="http://www.tei-c.org/ns/1.0" n="61v" facs="http://textgridrep.org/textgrid:164j3"/>
<tei:div xmlns:tei="http://www.tei-c.org/ns/1.0" type="page">
......@@ -3358,7 +3358,7 @@
Mecklenburg
.
<tei:handShift script="standard"/>
<anchor xml:id="C07_62v_s"/>
</tei:div>
<tei:pb xmlns:tei="http://www.tei-c.org/ns/1.0" type="cover"/>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment