Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
inel-corpora-exploration
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
INEL (Open Access)
inel-corpora-exploration
Commits
f53818a1
Commit
f53818a1
authored
4 years ago
by
Jettka, Daniel
Browse files
Options
Downloads
Patches
Plain Diff
slight change in global variable containing utterances from Wmatrix
parent
151fed54
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
usas-annotation/insert-usas-annotations.xsl
+7
-7
7 additions, 7 deletions
usas-annotation/insert-usas-annotations.xsl
with
7 additions
and
7 deletions
usas-annotation/insert-usas-annotations.xsl
+
7
−
7
View file @
f53818a1
...
@@ -30,9 +30,9 @@
...
@@ -30,9 +30,9 @@
<!-- new tiers -->
<!-- new tiers -->
<xsl:variable
name=
"pos-patterns"
select=
"'.*', 'N.*', 'V.*'"
as=
"xs:string+"
/>
<xsl:variable
name=
"pos-patterns"
select=
"'.*', 'N.*', 'V.*'"
as=
"xs:string+"
/>
<!-- the documents containing USAS-enriched utterances -->
<!-- the documents containing USAS-enriched utterances -->
<xsl:variable
name=
"wmatrix-
doc
s"
>
<xsl:variable
name=
"wmatrix-
utterance
s"
>
<xsl:for-each
select=
"$wmatrix-output-files"
>
<xsl:for-each
select=
"$wmatrix-output-files"
>
<xsl:copy-of
select=
"document(.)"
/>
<xsl:copy-of
select=
"document(.)
//*:u
"
/>
</xsl:for-each>
</xsl:for-each>
</xsl:variable>
</xsl:variable>
...
@@ -43,7 +43,7 @@
...
@@ -43,7 +43,7 @@
<!-- Templates -->
<!-- Templates -->
<xsl:template
match=
"/"
>
<xsl:template
match=
"/"
>
<xsl:for-each
select=
"distinct-values($wmatrix-
doc
s//*:u/@file-ref)"
>
<xsl:for-each
select=
"distinct-values($wmatrix-
utterance
s//*:u/@file-ref)"
>
<!-- overwrite the document -->
<!-- overwrite the document -->
<xsl:result-document
href=
"{.}"
>
<xsl:result-document
href=
"{.}"
>
<xsl:for-each
select=
"document(.)"
>
<xsl:for-each
select=
"document(.)"
>
...
@@ -54,7 +54,7 @@
...
@@ -54,7 +54,7 @@
</xsl:template>
</xsl:template>
<!-- ISO/TEI-Spoken: insert a new tier with USAS annotation -->
<!-- ISO/TEI-Spoken: insert a new tier with USAS annotation -->
<xsl:template
match=
"*:spanGrp[exists(key('utterance-by-file-and-category-and-speaker', concat(base-uri(), '#', @type, '#', ../@who), $wmatrix-
doc
s))]"
>
<xsl:template
match=
"*:spanGrp[exists(key('utterance-by-file-and-category-and-speaker', concat(base-uri(), '#', @type, '#', ../@who), $wmatrix-
utterance
s))]"
>
<xsl:variable
name=
"base-tier"
select=
"."
as=
"element()"
/>
<xsl:variable
name=
"base-tier"
select=
"."
as=
"element()"
/>
<xsl:variable
name=
"speaker"
select=
"../@who"
as=
"xs:string"
/>
<xsl:variable
name=
"speaker"
select=
"../@who"
as=
"xs:string"
/>
...
@@ -76,7 +76,7 @@
...
@@ -76,7 +76,7 @@
<spanGrp
type=
"{$new-tier-id}"
>
<spanGrp
type=
"{$new-tier-id}"
>
<xsl:for-each
select=
"$base-tier/*:span"
>
<xsl:for-each
select=
"$base-tier/*:span"
>
<xsl:variable
name=
"value"
select=
"string-join(key('words', concat(base-uri(), '#', $base-tier/@type, '#', $speaker, '#', @from, '#', @to), $wmatrix-
doc
s)[matches(@pos, concat('^', $pos-pattern))]/@sem, ' ')"
as=
"xs:string?"
/>
<xsl:variable
name=
"value"
select=
"string-join(key('words', concat(base-uri(), '#', $base-tier/@type, '#', $speaker, '#', @from, '#', @to), $wmatrix-
utterance
s)[matches(@pos, concat('^', $pos-pattern))]/@sem, ' ')"
as=
"xs:string?"
/>
<xsl:if
test=
"not(matches($value, '^\s*$'))"
>
<xsl:if
test=
"not(matches($value, '^\s*$'))"
>
<xsl:copy>
<xsl:copy>
<xsl:copy-of
select=
"@*"
/>
<xsl:copy-of
select=
"@*"
/>
...
@@ -92,7 +92,7 @@
...
@@ -92,7 +92,7 @@
<!-- EXB: insert a new tier with USAS annotation -->
<!-- EXB: insert a new tier with USAS annotation -->
<xsl:template
match=
"*:tier[exists(key('utterance-by-file-and-category-and-speaker', concat(base-uri(), '#', @category, '#', @speaker), $wmatrix-
doc
s))]"
>
<xsl:template
match=
"*:tier[exists(key('utterance-by-file-and-category-and-speaker', concat(base-uri(), '#', @category, '#', @speaker), $wmatrix-
utterance
s))]"
>
<xsl:variable
name=
"base-tier"
select=
"."
as=
"element()"
/>
<xsl:variable
name=
"base-tier"
select=
"."
as=
"element()"
/>
<xsl:variable
name=
"exists-more-than-one-speaker"
select=
"count(distinct-values(../*:tier/@speaker)) > 1"
as=
"xs:boolean"
/>
<xsl:variable
name=
"exists-more-than-one-speaker"
select=
"count(distinct-values(../*:tier/@speaker)) > 1"
as=
"xs:boolean"
/>
...
@@ -114,7 +114,7 @@
...
@@ -114,7 +114,7 @@
<tier
id=
"{$new-tier-id}"
speaker=
"{$base-tier/@speaker}"
category=
"{$new-tier-category}"
type=
"a"
display-name=
"{$new-tier-id}"
>
<tier
id=
"{$new-tier-id}"
speaker=
"{$base-tier/@speaker}"
category=
"{$new-tier-category}"
type=
"a"
display-name=
"{$new-tier-id}"
>
<xsl:for-each
select=
"$base-tier/*:event"
>
<xsl:for-each
select=
"$base-tier/*:event"
>
<xsl:variable
name=
"value"
select=
"string-join(key('words', concat(base-uri(), '#', $base-tier/@category, '#', $base-tier/@speaker, '#', @start, '#', @end), $wmatrix-
doc
s)[matches(@pos, concat('^', $pos-pattern))]/@sem, ' ')"
as=
"xs:string?"
/>
<xsl:variable
name=
"value"
select=
"string-join(key('words', concat(base-uri(), '#', $base-tier/@category, '#', $base-tier/@speaker, '#', @start, '#', @end), $wmatrix-
utterance
s)[matches(@pos, concat('^', $pos-pattern))]/@sem, ' ')"
as=
"xs:string?"
/>
<xsl:if
test=
"not(matches($value, '^\s*$'))"
>
<xsl:if
test=
"not(matches($value, '^\s*$'))"
>
<xsl:copy>
<xsl:copy>
<xsl:copy-of
select=
"@*"
/>
<xsl:copy-of
select=
"@*"
/>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment