diff --git a/insert-usas-annotation.sh b/insert-usas-annotation.sh index 3eff7072aace8fb643007c8f54566de0f1423a9e..b1f0d0b9ca4e8895764aeab7bb0f3c7af1ffbf24 100644 --- a/insert-usas-annotation.sh +++ b/insert-usas-annotation.sh @@ -1,7 +1,7 @@ #!/bin/bash java -jar software/saxon9he.jar usas-annotation/insert-usas-annotations.xsl -xsl:usas-annotation/insert-usas-annotations.xsl -for file in $(find corpora/ -name '*.exbu') +for file in $(find corpora/ -name '*.usas') do - mv $file $(echo "$file" | sed -r 's|.exbu|.exb|g') + mv $file $(echo "$file" | sed -r 's|.usas|.exb|g') done \ No newline at end of file diff --git a/usas-annotation/insert-usas-annotations.xsl b/usas-annotation/insert-usas-annotations.xsl index 45a58c715c111d757d8cbb961dd91a3873cc3cff..78b157a71c7a8d8a7410dbbc773ab4bcd7d76254 100644 --- a/usas-annotation/insert-usas-annotations.xsl +++ b/usas-annotation/insert-usas-annotations.xsl @@ -35,7 +35,7 @@ <xsl:copy-of select="document(.)//*:u"/> </xsl:for-each> </xsl:variable> - <xsl:variable name="result-files-extension" select="'.exbu'"/> + <xsl:variable name="result-files-extension" select="'.usas'"/> <!-- Keys --> <xsl:key name="words" match="w" use="concat(../@file-ref, '#', ../@tier-category, '#', ../@speaker, '#', ../@start, '#', ../@end)"/> @@ -49,7 +49,7 @@ <xsl:variable name="doc" select="document($file-ref)"/> <!-- overwrite the document --> <xsl:for-each select="$doc"> - <xsl:result-document href="{concat(replace($file-ref, '\.exb$', ''), $result-files-extension)}"> + <xsl:result-document href="{concat(string-join(tokenize($file-ref, '\.')[position() != last()], '.'), $result-files-extension)}"> <xsl:apply-templates/> </xsl:result-document> </xsl:for-each> @@ -90,7 +90,7 @@ </spanGrp> </xsl:for-each> - <xsl:message select="concat('*** Inserted USAS tier/s for speaker ', $speaker, ' in file ', base-uri())"/> + <xsl:message select="concat('*** Inserted USAS tier/s for speaker ', $speaker, ' in file ', concat(string-join(tokenize(base-uri(), '\.')[position() != last()], '.'), $result-files-extension))"/> </xsl:template>