Commit a6c97c7c authored by mrodzis's avatar mrodzis 🐸
Browse files

Merge branch 'feature/#90-short-titles' into 'develop'

Add info about short titles to interformat

Closes #90

See merge request !27
parents 9ae95e90 ae9647d3
......@@ -85,50 +85,54 @@ declare variable $index-info:wrk-map :=
else
"false"
return
if($creators and $periodical) then
map:entry(string($entry/@xml:id),
let $same-as :=
if($periodical) then
$entry/ancestor::tei:list[@type = "periodicals"]//tei:item[not(@xml:id)][descendant::tei:ptr[@target = concat("#", $entry/@xml:id)]]/tei:name
else
()
let $same-as :=
if(count($same-as) gt 1) then
string-join($same-as/string(), ", ")
else if(count($same-as) = 1) then
$same-as/string()
else
()
let $general-map :=
map {
"regular-name" : string-join($entry/tei:name[not(@type)], ", "),
"creator-ids" : string-join($creator-ids, " "),
"periodical" : $is-periodical,
"type" : "work"
}
)
else if($creators) then
return
if($creators and $periodical
or $creators) then
let $updated-map := map:put($general-map, "creator-ids", string-join($creator-ids, " "))
return
map:entry(string($entry/@xml:id),
map {
"regular-name" : string-join($entry/tei:name[not(@type)], ", "),
"creator-ids" : string-join($creator-ids, " "),
"periodical" : $is-periodical,
"type" : "work"
}
if($same-as) then
map:put($updated-map, "same-as", $same-as)
else
$updated-map
)
else if($created-by-fontane) then
map:entry(string($entry/@xml:id),
map {
"regular-name" : string-join($entry/tei:name[not(@type)], ", "),
"creator" : "Fontane",
"periodical" : $is-periodical,
"type" : "work"
}
map:put($general-map, "creator", "Fontane")
)
else if($periodical) then
map:entry(string($entry/@xml:id),
map {
"regular-name" : string-join($entry/tei:name[not(@type)], ", "),
"periodical" : $is-periodical,
"type" : "work"
}
if($same-as) then
map:put($general-map, "same-as", $same-as)
else
$general-map
)
else
map:entry(string($entry/@xml:id),
map {
"regular-name" : string-join($entry/tei:name[not(@type)], ", "),
"creator" : "Anonym/nicht ermittelt",
"periodical" : $is-periodical,
"type" : "work"
}
map:put($general-map, "creator", "Anonym/nicht ermittelt")
),
(: (fictional) characters mentioned/depicted in works :)
for $person in doc($config:data-root || "/data/253t3.xml")//tei:person
......
......@@ -365,7 +365,8 @@ declare function fontaneSimple:transform($nodes as node()*, $uri as xs:string) a
and $node/following::*[1][self::tei:hi]) then
text{"@"}
else
())
()
)
(: TODO if $node/@type = "highlighted" then make
a hi[@type = "vertical-mark"] in the second stage of creating the
......@@ -775,7 +776,7 @@ declare function fontaneSimple:transform($nodes as node()*, $uri as xs:string) a
},
if(not($node//tei:abbr/text()[ends-with(., ":")]
or ($node//text()[last()][ends-with(., "-")] or $node/following-sibling::*[1][self::tei:rs])
or $node/following::text()[1][starts-with(., "-") or starts-with(., ".")]
or $node/following::text()[1][starts-with(., "-") or starts-with(., ".") or starts-with(., ")")]
or $node/following::text()[1][matches(substring(., 1, 1), "[\w]")]
or $node/following::*[1][self::tei:handShift])
(: or $node/following-sibling::node()[1][starts-with(., "-") or starts-with(., ".")]):)
......@@ -1209,11 +1210,18 @@ as xs:string) as element(tei:term)+ {
$creator-id
let $type := index-info:get-info-about($index-type, $ref, "periodical")
let $same-as := index-info:get-info-about($index-type, $ref, "same-as")
let $no-of-ids := count($creators)
return
(
fontaneSimple:make-term("periodical", $type),
if($same-as) then
fontaneSimple:make-term("same-as", $same-as)
else
(),
if($subref-ids) then
for $iii in 1 to $no-of-ids return
let $subref := index-info:get-info-about("psn", $creators[$iii], "regular-name")
......
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