Commit cfe9d685 authored by MRodz's avatar MRodz Committed by mrodzis
Browse files

Add 3.12.8. Illegible words and characters

parent c9d77679
......@@ -263,4 +263,13 @@ declare
fontane-simple:transform($node)
};
(: ILLEGIBLE CHARACTERS :)
(: ILLEGIBLE CHARACTERS AND WORDS :)
declare
%test:name("Illegible characters and words")
%test:args("<gap xmlns=""http://www.tei-c.org/ns/1.0"" reason=""illegible"" unit=""uc_chars"" quantity=""1""/>")
%test:assertEquals("<gap xmlns=""http://www.tei-c.org/ns/1.0"" reason=""illegible"" unit=""uc_chars"" quantity=""1""/>")
%test:args("<gap xmlns=""http://www.tei-c.org/ns/1.0"" reason=""damage"" unit=""mm"" quantity=""64""/>")
%test:assertEquals("<gap xmlns=""http://www.tei-c.org/ns/1.0"" reason=""damage"" unit=""mm"" quantity=""64""/>")
function teisimple-test:analyze-illeg-word($node as element(*)) {
fontane-simple:transform($node)
};
\ No newline at end of file
......@@ -18,6 +18,7 @@ module namespace fontane-simple="http://fontane-nb.dariah.eu/teisimple";
declare namespace tei="http://www.tei-c.org/ns/1.0";
declare namespace test="http://exist-db.org/xquery/xqsuite";
import module namespace config="http://textgrid.de/ns/SADE/config" at "../config/config.xqm";
import module namespace console="http://exist-db.org/xquery/console";
(:~
......@@ -26,7 +27,7 @@ import module namespace console="http://exist-db.org/xquery/console";
: TODO: adapt to several input files?
:
: :)
declare function fontane-simple:main($file as xs:string) as element(tei:TEI) {
declare function fontane-simple:main($file as xs:string) as xs:string? {
let $doc :=
try {
(doc("/db/sade-projects/textgrid/data/xml/data/" || $file))
......@@ -39,8 +40,7 @@ declare function fontane-simple:main($file as xs:string) as element(tei:TEI) {
let $content := $doc//tei:sourceDoc/tei:surface[not(contains(@n, "cover")
and matches(@n, "spine"))]
return
<TEI xmlns="http://www.tei-c.org/ns/1.0">
let $tei := <TEI xmlns="http://www.tei-c.org/ns/1.0">
{$doc//tei:teiHeader}
<text>
<front>{fontane-simple:transform($front-covers)}</front>
......@@ -48,6 +48,7 @@ declare function fontane-simple:main($file as xs:string) as element(tei:TEI) {
<back>{fontane-simple:transform($back-covers)}</back>
</text>
</TEI>
return xmldb:store("/db/apps/SADE/resources/xml/", "tei-simple.xml", $tei)
};
(:~
......@@ -185,6 +186,11 @@ declare function fontane-simple:transform($nodes as node()*) as node()* {
fontane-simple:transform($node/node())
else
()
case element(tei:gap)
return
element tei:gap {
$node/@*
}
default return
fontane-simple:transform($node/node())
};
......
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