Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
fontane-notizbuecher
SADE
Commits
5ed7d397
Commit
5ed7d397
authored
Jul 06, 2018
by
MRodz
Committed by
mrodzis
Feb 05, 2019
Browse files
Add first draft for 3.2 text interventions
parent
d6fc8ee7
Changes
2
Hide whitespace changes
Inline
Side-by-side
modules/fontane/teisimpleprint/tei2teisimple.xqm
View file @
5ed7d397
...
...
@@ -119,17 +119,26 @@ declare function fontaneSimple:transform($nodes as node()*) as node()* {
if($node/@type = "edited_text"
or $node/child::tei:seg[@type = "multiphrase"]) then
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/@rend ="|") then
fontaneSimple:transform($node/node())
else if(not($node/@xml:id)) then
fontaneSimple:transform($node/node())
else if(simpleHelpers:is-transposed($node)) then
let $corresp := //tei:metamark[matches(@target, $node/@xml:id)]
return
(fontaneSimple:transform($corresp/node()),
fontaneSimple:transform($node/node()))
else
fontaneSimple:transform($node/node())
...
...
@@ -173,7 +182,7 @@ declare function fontaneSimple:transform($nodes as node()*) as node()* {
case element(tei:seg) return
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
()
...
...
@@ -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
modules/fontane/teisimpleprint/tests/teisimple-test.xql
View file @
5ed7d397
...
...
@@ -39,6 +39,22 @@ declare
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 :)
declare
%test:name("Glued pages")
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment