Skip to content

Commit

Permalink
Improve bad lemma warning message.
Browse files Browse the repository at this point in the history
  • Loading branch information
TomazErjavec committed Feb 5, 2024
1 parent dd1e0e5 commit 6b7436d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Scripts/parlamint2release.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -576,20 +576,20 @@

<!-- Bug where lemma is empty or "_": change to @norm, if it exists, else to text() of the word -->
<xsl:template mode="comp" match="tei:w/@lemma[not(normalize-space(.)) or . = '_']">
<xsl:variable name="message" select="concat('WARN ', /tei:TEI/@xml:id, ': changing bad lemma to ')"/>
<xsl:variable name="message" select="concat('WARN ', /tei:TEI/@xml:id, ': changing bad lemma ', ., ' to ')"/>
<xsl:variable name="location" select="concat(' in ', ../@xml:id)"/>
<xsl:attribute name="lemma">
<xsl:choose>
<xsl:when test="../@norm">
<xsl:message select="concat($message, ' @norm ', ../@norm, $location)"/>
<xsl:message select="concat($message, '@norm ', ../@norm, $location)"/>
<xsl:value-of select="../@norm"/>
</xsl:when>
<xsl:when test="../contains(@msd, 'UPosTag=PROPN')">
<xsl:message select="concat($message, ' PROPN token ', ../text(), $location)"/>
<xsl:message select="concat($message, 'PROPN token ', ../text(), $location)"/>
<xsl:value-of select="../text()"/>
</xsl:when>
<xsl:otherwise>
<xsl:message select="concat($message, ' lower-cased token ', lower-case(../text()), $location)"/>
<xsl:message select="concat($message, 'lower-cased token ', lower-case(../text()), $location)"/>
<xsl:value-of select="lower-case(../text())"/>
</xsl:otherwise>
</xsl:choose>
Expand Down

0 comments on commit 6b7436d

Please sign in to comment.