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
No related branches found
No related tags found
No related merge requests found
...@@ -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-docs"> <xsl:variable name="wmatrix-utterances">
<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-docs//*:u/@file-ref)"> <xsl:for-each select="distinct-values($wmatrix-utterances//*: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-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="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-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: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-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="base-tier" select="." as="element()"/>
<xsl:variable name="exists-more-than-one-speaker" select="count(distinct-values(../*:tier/@speaker)) &gt; 1" as="xs:boolean"/> <xsl:variable name="exists-more-than-one-speaker" select="count(distinct-values(../*:tier/@speaker)) &gt; 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-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:if test="not(matches($value, '^\s*$'))">
<xsl:copy> <xsl:copy>
<xsl:copy-of select="@*"/> <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