Skip to content

Commit

Permalink
Add number of <l> and <p> elements to meta data
Browse files Browse the repository at this point in the history
resolves #138
  • Loading branch information
Carsten Milling committed Jul 1, 2021
1 parent 72c156b commit d51897c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/api.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ declare variable $api:metadata-columns := (
"numOfActs",
"wordCountText",
"wordCountSp",
"wordCountStage"
"wordCountStage",
"numOfP",
"numOfL"
);

(:~
Expand Down
5 changes: 5 additions & 0 deletions modules/util.xqm
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,9 @@ declare function dutil:get-corpus-meta-data(
let $num-unknown := count($cast[@sex="UNKNOWN"])
let $num-groups := count($cast[name()="personGrp"])

let $num-p := count($tei//tei:body//tei:sp//tei:p)
let $num-l := count($tei//tei:body//tei:sp//tei:l)

let $stat := $metrics[@name=$name]
let $max-degree-ids := tokenize($stat/network/maxDegreeIds)
let $wikidata-id :=
Expand Down Expand Up @@ -576,6 +579,8 @@ declare function dutil:get-corpus-meta-data(
"numOfSpeakersFemale": $num-female,
"numOfSpeakersUnknown": $num-unknown,
"numOfPersonGroups": $num-groups,
"numOfP": $num-p,
"numOfL": $num-l,
"wikipediaLinkCount": $sitelink-count,
"wordCountText": xs:integer($stat/text/string()),
"wordCountSp": xs:integer($stat/sp/string()),
Expand Down

0 comments on commit d51897c

Please sign in to comment.