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

Add first draft for 3.2 text interventions

parent d6fc8ee7
...@@ -119,17 +119,26 @@ declare function fontaneSimple:transform($nodes as node()*) as node()* { ...@@ -119,17 +119,26 @@ declare function fontaneSimple:transform($nodes as node()*) as node()* {
if($node/@type = "edited_text" if($node/@type = "edited_text"
or $node/child::tei:seg[@type = "multiphrase"]) then or $node/child::tei:seg[@type = "multiphrase"]) then
fontaneSimple:copy-element($node) fontaneSimple:copy-element($node)
else if($node[matches(@copyOf, $node/preceding::tei:seg/@xml:id)
and not(@cause = "unclear")]) then
fontaneSimple:mark-syllable-duplication($node)
else if($node/@cause ="catchword" or $node/@cause ="unclear") then else if($node/@cause ="catchword" or $node/@cause ="unclear") then
() ()
else if($node/@rend ="|") then else if($node/@rend ="|") then
fontaneSimple:transform($node/node()) fontaneSimple:transform($node/node())
else if(not($node/@xml:id)) then else if(not($node/@xml:id)) then
fontaneSimple:transform($node/node()) fontaneSimple:transform($node/node())
else if(simpleHelpers:is-transposed($node)) then else if(simpleHelpers:is-transposed($node)) then
let $corresp := //tei:metamark[matches(@target, $node/@xml:id)] let $corresp := //tei:metamark[matches(@target, $node/@xml:id)]
return return
(fontaneSimple:transform($corresp/node()), (fontaneSimple:transform($corresp/node()),
fontaneSimple:transform($node/node())) fontaneSimple:transform($node/node()))
else else
fontaneSimple:transform($node/node()) fontaneSimple:transform($node/node())
...@@ -173,7 +182,7 @@ declare function fontaneSimple:transform($nodes as node()*) as node()* { ...@@ -173,7 +182,7 @@ declare function fontaneSimple:transform($nodes as node()*) as node()* {
case element(tei:seg) return case element(tei:seg) return
if(count($node/*) = 1 and if(count($node/*) = 1 and
($node/child::tei:stamp or $node/child::tei:metamark[@function = "caret"])) ($node/tei:stamp or $node/tei:metamark[@function = "caret"]))
then then
() ()
...@@ -611,3 +620,14 @@ as element(tei:handShift) { ...@@ -611,3 +620,14 @@ as element(tei:handShift) {
() ()
} }
}; };
declare function fontaneSimple:mark-syllable-duplication($node as element(tei:add))
as element(tei:seg) {
element tei:seg {
attribute type {"reduplication"},
<hi>‹</hi>,
fontaneSimple:transform($node/node()),
<hi>›</hi>
}
};
\ No newline at end of file
...@@ -39,6 +39,22 @@ declare ...@@ -39,6 +39,22 @@ declare
fontaneSimple:transform($node) fontaneSimple:transform($node)
}; };
(: 3.2 Intervening in texts :)
declare
%test:name("Intervening in texts")
%test:args("<zone xmlns=""http://www.tei-c.org/ns/1.0""><surface xmlns=""http://www.tei-c.org/ns/1.0"" n=""10v""><zone xmlns=""http://www.tei-c.org/ns/1.0""><line xmlns=""http://www.tei-c.org/ns/1.0""><seg xmlns=""http://www.tei-c.org/ns/1.0"" xml:id=""C03_10v_1"">mar</seg>-</line></zone><zone><line><add copyOf=""#C03_10v_1"" cause=""catchword"">mar</add>mor</line></zone></surface></zone>")
%test:assertEquals("<pb xmlns=""http://www.tei-c.org/ns/1.0"" n=""10v""/>", "mar", "<seg xmlns=""http://www.tei-c.org/ns/1.0"" type=""reduplication""><hi xmlns=""http://www.tei-c.org/ns/1.0"" >‹</hi>mar<hi xmlns=""http://www.tei-c.org/ns/1.0"" >›</hi></seg>", "mor")
%test:args("<zone xmlns=""http://www.tei-c.org/ns/1.0""><line xmlns=""http://www.tei-c.org/ns/1.0"">ei<mod xmlns=""http://www.tei-c.org/ns/1.0"" type=""subst""><del xmlns=""http://www.tei-c.org/ns/1.0"" rend=""overwritten"">l</del><add xmlns=""http://www.tei-c.org/ns/1.0"" place=""superimposed"">n</add></mod>la<seg xmlns=""http://www.tei-c.org/ns/1.0"" xml:id=""C02_32r_1"">den</seg>-</line><line xmlns=""http://www.tei-c.org/ns/1.0""><add xmlns=""http://www.tei-c.org/ns/1.0"" copyOf=""#C02_32r_1"">den</add>den</line></zone>")
%test:assertEquals("ei", "n", "la", "den", "<seg xmlns=""http://www.tei-c.org/ns/1.0"" type=""reduplication""><hi xmlns=""http://www.tei-c.org/ns/1.0"" >‹</hi>den<hi xmlns=""http://www.tei-c.org/ns/1.0"" >›</hi></seg>", "den")
%test:args("<line xmlns=""http://www.tei-c.org/ns/1.0""><seg xmlns=""http://www.tei-c.org/ns/1.0"" xml:id=""D08_7v_1"">und</seg><add xmlns=""http://www.tei-c.org/ns/1.0"" place=""above"" copyOf=""#D08_7v_1"" cause=""unclear"">und</add></line>")
%test:assertEquals("und")
function teisimple-test:analyze-interventions($node as element(*)) {
fontaneSimple:transform($node)
};
(: 3.5 Glued Pages :) (: 3.5 Glued Pages :)
declare declare
%test:name("Glued pages") %test:name("Glued pages")
......
Supports Markdown
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