Skip to content
Snippets Groups Projects
Commit f53818a1 authored by Jettka, Daniel's avatar Jettka, Daniel
Browse files

slight change in global variable containing utterances from Wmatrix

parent 151fed54
Branches
No related tags found
No related merge requests found
......@@ -30,9 +30,9 @@
<!-- new tiers -->
<xsl:variable name="pos-patterns" select="'.*', 'N.*', 'V.*'" as="xs:string+"/>
<!-- the documents containing USAS-enriched utterances -->
<xsl:variable name="wmatrix-docs">
<xsl:variable name="wmatrix-utterances">
<xsl:for-each select="$wmatrix-output-files">
<xsl:copy-of select="document(.)"/>
<xsl:copy-of select="document(.)//*:u"/>
</xsl:for-each>
</xsl:variable>
......@@ -43,7 +43,7 @@
<!-- Templates -->
<xsl:template match="/">
<xsl:for-each select="distinct-values($wmatrix-docs//*:u/@file-ref)">
<xsl:for-each select="distinct-values($wmatrix-utterances//*:u/@file-ref)">
<!-- overwrite the document -->
<xsl:result-document href="{.}">
<xsl:for-each select="document(.)">
......@@ -54,7 +54,7 @@
</xsl:template>
<!-- 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-docs))]">
<xsl:template match="*:spanGrp[exists(key('utterance-by-file-and-category-and-speaker', concat(base-uri(), '#', @type, '#', ../@who), $wmatrix-utterances))]">
<xsl:variable name="base-tier" select="." as="element()"/>
<xsl:variable name="speaker" select="../@who" as="xs:string"/>
......@@ -76,7 +76,7 @@
<spanGrp type="{$new-tier-id}">
<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-docs)[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-utterances)[matches(@pos, concat('^', $pos-pattern))]/@sem, ' ')" as="xs:string?"/>
<xsl:if test="not(matches($value, '^\s*$'))">
<xsl:copy>
<xsl:copy-of select="@*"/>
......@@ -92,7 +92,7 @@
<!-- 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-docs))]">
<xsl:template match="*:tier[exists(key('utterance-by-file-and-category-and-speaker', concat(base-uri(), '#', @category, '#', @speaker), $wmatrix-utterances))]">
<xsl:variable name="base-tier" select="." as="element()"/>
<xsl:variable name="exists-more-than-one-speaker" select="count(distinct-values(../*:tier/@speaker)) &gt; 1" as="xs:boolean"/>
......@@ -114,7 +114,7 @@
<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:variable name="value" select="string-join(key('words', concat(base-uri(), '#', $base-tier/@category, '#', $base-tier/@speaker, '#', @start, '#', @end), $wmatrix-docs)[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-utterances)[matches(@pos, concat('^', $pos-pattern))]/@sem, ' ')" as="xs:string?"/>
<xsl:if test="not(matches($value, '^\s*$'))">
<xsl:copy>
<xsl:copy-of select="@*"/>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment