Skip to content

Commit

Permalink
processing @cert on forenames, closes #29
Browse files Browse the repository at this point in the history
  • Loading branch information
peterstadler committed Mar 13, 2017
1 parent ed1e683 commit dc4b34f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
12 changes: 6 additions & 6 deletions modules/app.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -775,12 +775,12 @@ declare
%templates:default("lang", "en")
function app:person-basic-data($node as node(), $model as map(*), $lang as xs:string) as map(*) {
map{
'fullnames' := $model('doc')//tei:persName[@type = 'full'],
'pseudonyme' := $model('doc')//tei:persName[@type = 'pseud'],
'birthnames' := $model('doc')//tei:persName[@subtype = 'birth'],
'realnames' := $model('doc')//tei:persName[@type = 'real'],
'altnames' := $model('doc')//tei:persName[@type = 'alt'][not(@subtype)] | $model('doc')//tei:orgName[@type = 'alt'],
'marriednames' := $model('doc')//tei:persName[@subtype = 'married'],
'fullnames' := $model('doc')//tei:persName[@type = 'full'] ! string-join(wega-util:txtFromTEI(.), ''),
'pseudonyme' := $model('doc')//tei:persName[@type = 'pseud'] ! string-join(wega-util:txtFromTEI(.), ''),
'birthnames' := $model('doc')//tei:persName[@subtype = 'birth'] ! string-join(wega-util:txtFromTEI(.), ''),
'realnames' := $model('doc')//tei:persName[@type = 'real'] ! string-join(wega-util:txtFromTEI(.), ''),
'altnames' := $model('doc')//tei:persName[@type = 'alt'][not(@subtype)] | $model('doc')//tei:orgName[@type = 'alt'] ! string-join(wega-util:txtFromTEI(.), ''),
'marriednames' := $model('doc')//tei:persName[@subtype = 'married'] ! string-join(wega-util:txtFromTEI(.), ''),
'birth' := $model('doc')//tei:birth[count(tei:* except tei:date[@type]) gt 0],
'baptism' := $model('doc')//tei:birth/tei:date[@type='baptism'],
'death' := $model('doc')//tei:death[count(tei:* except tei:date[@type]) gt 0],
Expand Down
8 changes: 4 additions & 4 deletions modules/wdt.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ declare function wdt:persons($item as item()*) as map(*) {
default return $item/root()/tei:person
return
switch($serialization)
case 'txt' return str:normalize-space($person/tei:persName[@type = 'reg'])
case 'html' return <span>{str:normalize-space($person/tei:persName[@type = 'reg'])}</span>
case 'txt' return str:normalize-space(string-join(wega-util:txtFromTEI($person/tei:persName[@type = 'reg']), ''))
case 'html' return <span>{str:normalize-space(string-join(wega-util:txtFromTEI($person/tei:persName[@type = 'reg']), ''))}</span>
default return core:logToFile('error', 'wdt:persons()("title"): unsupported serialization "' || $serialization || '"')
},
'label-facets' := function() as xs:string? {
Expand Down Expand Up @@ -262,7 +262,7 @@ declare function wdt:writings($item as item()*) as map(*) {
else false()
},
'filter' := function() as document-node()* {
$item/root()/descendant::tei:text[@type=('performance-review', 'historic-news', 'concert-announcement')]/root()
$item/root()/descendant::tei:text[@type=('performance-review', 'historic-news')]/root()
},
'filter-by-person' := function($personID as xs:string) as document-node()* {
$item/root()//tei:author[@key = $personID][ancestor::tei:fileDesc]/root()
Expand All @@ -273,7 +273,7 @@ declare function wdt:writings($item as item()*) as map(*) {
for $i in wdt:writings($item)('filter')() order by sort:index('writings', $i) ascending return $i
},
'init-collection' := function() as document-node()* {
core:data-collection('writings')/descendant::tei:text[@type=('performance-review', 'historic-news', 'concert-announcement')]/root()
core:data-collection('writings')/descendant::tei:text[@type=('performance-review', 'historic-news')]/root()
},
'init-sortIndex' := function() as item()* {
wdt:create-index-callback('writings', wdt:writings(())('init-collection')(), function($node) {
Expand Down
3 changes: 3 additions & 0 deletions modules/wega-util.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,9 @@ declare function wega-util:txtFromTEI($nodes as node()*) as xs:string* {
for $node in $nodes
return
typeswitch($node)
case element(tei:forename) return
if($node/@cert) then ($node/child::node() ! wega-util:txtFromTEI(.), '(?)')
else $node/child::node() ! wega-util:txtFromTEI(.)
case element(tei:del) return ()
case element(tei:note) return ()
case element(tei:lb) return
Expand Down

0 comments on commit dc4b34f

Please sign in to comment.