<commit_before><?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
    xmlns:related-links="http://dita-ot.sourceforge.net/ns/200709/related-links"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    exclude-result-prefixes="related-links xs">
    
    <xsl:template match="*[contains(@class, ' termentry/termBody ')]">
        <!-- Does the <termBody> has <fullForm> children -->
        <xsl:if test="*[contains(@class, ' termentry/termNotation ')]">
            <xsl:element name="table">
                <xsl:attribute name="class">termTable</xsl:attribute>
                <xsl:element name="tr">
                    <xsl:element name="th">
                        <xsl:attribute name="class">termTable</xsl:attribute>
                        <xsl:call-template name="getVariable">
                            <xsl:with-param name="id" select="'Term'"/>
                        </xsl:call-template>
                    </xsl:element>
                    <xsl:element name="th">
                        <xsl:attribute name="class">termTable</xsl:attribute>
                        <xsl:call-template name="getVariable">
                            <xsl:with-param name="id" select="'Term Type'"/>
                        </xsl:call-template>
                    </xsl:element>
                    <xsl:element name="th">
                        <xsl:attribute name="class">termTable</xsl:attribute>
                        <xsl:call-template name="getVariable">
                            <xsl:with-param name="id" select="'Term Language'"/>
                        </xsl:call-template>
                    </xsl:element>
                    <xsl:element name="th">
                        <xsl:attribute name="class">termTable</xsl:attribute>
                        <xsl:call-template name="getVariable">
                            <xsl:with-param name="id" select="'Term Usage'"/>
                        </xsl:call-template>
                    </xsl:element>
                    <xsl:element name="th">
                        <xsl:attribute name="class">termTable</xsl:attribute>
                        <xsl:call-template name="getVariable">
                            <xsl:with-param name="id" select="'Term Source'"/>
                        </xsl:call-template>
                    </xsl:element>
                    <xsl:element name="th">
                        <xsl:attribute name="class">termTable</xsl:attribute>
                        <xsl:call-template name="getVariable">
                            <xsl:with-param name="id" select="'Term Context'"/>
                        </xsl:call-template>
                    </xsl:element>
                    <xsl:element name="th">
                        <xsl:attribute name="class">termTable</xsl:attribute>
                        <xsl:call-template name="getVariable">
                            <xsl:with-param name="id" select="'Term Annotations'"/>
                        </xsl:call-template>
                    </xsl:element>
                </xsl:element>
                <xsl:apply-templates/>
            </xsl:element>
        </xsl:if>
    </xsl:template>
       
    <xsl:template match="*[contains(@class, ' termentry/termNotation ')]">
        <xsl:element name="tr">
            <!-- Term -->
            <xsl:element name="td">
                <xsl:attribute name="class">termTable</xsl:attribute>
                <xsl:value-of select="*[contains(@class, ' termentry/termVariant ')]"/>
            </xsl:element>
            <!-- Type -->
            <xsl:element name="td">
                <xsl:attribute name="class">termTable</xsl:attribute>
                <xsl:choose>
                    <xsl:when test="contains(@class, ' termentry/fullForm ')">
                        <xsl:call-template name="getVariable">
                            <xsl:with-param name="id" select="'Full Form'"/>
                        </xsl:call-template>
                    </xsl:when>
                    <xsl:when test="contains(@class, ' termentry/abbreviation ')">
                        <xsl:call-template name="getVariable">
                            <xsl:with-param name="id" select="'Abbreviation'"/>
                        </xsl:call-template>
                    </xsl:when>
                    <xsl:when test="contains(@class, ' termentry/acronym ')">
                        <xsl:call-template name="getVariable">
                            <xsl:with-param name="id" select="'Acronym'"/>
                        </xsl:call-template>
                    </xsl:when>
                    <xsl:when test="contains(@class, ' termentry/verb ')">
                        <xsl:call-template name="getVariable">
                            <xsl:with-param name="id" select="'Verb'"/>
                        </xsl:call-template>
                    </xsl:when>
                </xsl:choose>
            </xsl:element>
            <!-- Language -->
            <xsl:element name="td">
                <xsl:attribute name="class">termTable</xsl:attribute>
                <xsl:value-of select="@language"/>
            </xsl:element>
            <!-- Usage -->
            <xsl:element name="td">
                <xsl:attribute name="class">termTable</xsl:attribute>
                <xsl:choose>
                    <xsl:when test="contains(@usage, 'preferred')">
                        <xsl:call-template name="getVariable">
                            <xsl:with-param name="id" select="'Usage Allowed'"/>
                        </xsl:call-template>
                    </xsl:when>
                    <xsl:when test="contains(@usage, 'notRecommended')">
                        <xsl:call-template name="getVariable">
                            <xsl:with-param name="id" select="'Usage Deprecated'"/>
                        </xsl:call-template>
                    </xsl:when>
                </xsl:choose>
            </xsl:element>
            <!-- Source -->
            <xsl:element name="td">
                <xsl:attribute name="class">termTable</xsl:attribute>
                <xsl:apply-templates select="*[contains(@class, ' termentry/termSource ')]"/>
            </xsl:element>
            <!-- Context -->
            <xsl:element name="td">
                <xsl:attribute name="class">termTable</xsl:attribute>
                <xsl:apply-templates select="*[contains(@class, ' termentry/termContext ')]"/>
            </xsl:element>
            <!-- Annotation -->
            <xsl:element name="td">
                <xsl:attribute name="class">termTable</xsl:attribute>
                <xsl:apply-templates select="*[contains(@class, ' termentry/annotation ')]"/>
            </xsl:element>
        </xsl:element>
    </xsl:template>
    
    <xsl:template match="*[contains(@class, ' termentry/sourceName ')]">
        <xsl:value-of select="."/>
    </xsl:template>
    
    <xsl:template match="*[contains(@class, ' termentry/agreedWith ')]">
        <xsl:element name="div">
            <xsl:attribute name="class">termentryDiv</xsl:attribute>
            <xsl:element name="strong">
                <xsl:attribute name="class">termentryLabel</xsl:attribute>
                <xsl:call-template name="getVariable">
                    <xsl:with-param name="id" select="'Agreed With'"/>
                </xsl:call-template>
            </xsl:element>
            <xsl:element name="br"/>
            <xsl:apply-templates/>
        </xsl:element>
    </xsl:template>
    
    <xsl:template match="*[contains(@class, ' termentry/termCommitteeMember ')]">
        <xsl:element name="li">
            <xsl:attribute name="class">termCommitteeMember</xsl:attribute>
            <xsl:element name="strong">
                <xsl:attribute name="class">termentryLabel</xsl:attribute>
                <xsl:call-template name="getVariable">
                    <xsl:with-param name="id" select="'Term Committee Member'"/>
                </xsl:call-template>
            </xsl:element>
            <xsl:apply-templates/>
        </xsl:element>
    </xsl:template>
    
    <!-- Hypernyms have their own group. -->
    <xsl:template match="*[contains(@class, ' termentry/hypernym ')]" mode="related-links:get-group"
                  name="related-links:group.hypernyms"
                  as="xs:string">
         <xsl:text>hypernym</xsl:text>
    </xsl:template>
    
    <!-- Hyponyms have their own group. -->
    <xsl:template match="*[contains(@class, ' termentry/hyponym ')]" mode="related-links:get-group"
                  name="related-links:group.hyponyms"
                  as="xs:string">
         <xsl:text>hyponym</xsl:text>
    </xsl:template>
    
    <!-- Related Terms have their own group. -->
    <xsl:template match="*[contains(@class, ' termentry/relatedTerm ')]" mode="related-links:get-group"
                  name="related-links:group.relatedTerms"
                  as="xs:string">
         <xsl:text>relatedTerm</xsl:text><commit_msg>Process definition elements in XHTML<commit_after><?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
    xmlns:related-links="http://dita-ot.sourceforge.net/ns/200709/related-links"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    exclude-result-prefixes="related-links xs">
    
    <xsl:template match="*[contains(@class, ' termentry/definition ')]">
        <xsl:element name="div">
            <xsl:attribute name="class">section definition</xsl:attribute>
            <xsl:element name="h2">
                <xsl:attribute name="class">title sectiontitle</xsl:attribute>
                <xsl:call-template name="getVariable">
                    <xsl:with-param name="id" select="'Definition'"/>
                </xsl:call-template>
            </xsl:element>
            <xsl:apply-templates/>
        </xsl:element>
    </xsl:template>
    
    <xsl:template match="*[contains(@class, ' termentry/definitionText ')]">
        <xsl:element name="p">
            <xsl:attribute name="class">shortdesc definitionText</xsl:attribute>
            <xsl:apply-templates/>
        </xsl:element>
    </xsl:template>
    
    <xsl:template match="*[contains(@class, ' termentry/definitionSource ')]">
        <xsl:element name="p">
            <xsl:attribute name="class">definitionSource</xsl:attribute>
            <xsl:element name="b">
                <xsl:call-template name="getVariable">
                    <xsl:with-param name="id" select="'Definition Source'"/>
                </xsl:call-template>
                <xsl:call-template name="getVariable">
                    <xsl:with-param name="id" select="'Delimiter String'"/>
                </xsl:call-template>
            </xsl:element>
            <xsl:apply-templates/>
        </xsl:element>
    </xsl:template>
    
    <xsl:template match="*[contains(@class, ' termentry/termBody ')]">
        <!-- Does the <termBody> has <fullForm> children -->
        <xsl:if test="*[contains(@class, ' termentry/termNotation ')]">
            <xsl:element name="table">
                <xsl:attribute name="class">termTable</xsl:attribute>
                <xsl:element name="tr">
                    <xsl:element name="th">
                        <xsl:attribute name="class">termTable</xsl:attribute>
                        <xsl:call-template name="getVariable">
                            <xsl:with-param name="id" select="'Term'"/>
                        </xsl:call-template>
                    </xsl:element>
                    <xsl:element name="th">
                        <xsl:attribute name="class">termTable</xsl:attribute>
                        <xsl:call-template name="getVariable">
                            <xsl:with-param name="id" select="'Term Type'"/>
                        </xsl:call-template>
                    </xsl:element>
                    <xsl:element name="th">
                        <xsl:attribute name="class">termTable</xsl:attribute>
                        <xsl:call-template name="getVariable">
                            <xsl:with-param name="id" select="'Term Language'"/>
                        </xsl:call-template>
                    </xsl:element>
                    <xsl:element name="th">
                        <xsl:attribute name="class">termTable</xsl:attribute>
                        <xsl:call-template name="getVariable">
                            <xsl:with-param name="id" select="'Term Usage'"/>
                        </xsl:call-template>
                    </xsl:element>
                    <xsl:element name="th">
                        <xsl:attribute name="class">termTable</xsl:attribute>
                        <xsl:call-template name="getVariable">
                            <xsl:with-param name="id" select="'Term Source'"/>
                        </xsl:call-template>
                    </xsl:element>
                    <xsl:element name="th">
                        <xsl:attribute name="class">termTable</xsl:attribute>
                        <xsl:call-template name="getVariable">
                            <xsl:with-param name="id" select="'Term Context'"/>
                        </xsl:call-template>
                    </xsl:element>
                    <xsl:element name="th">
                        <xsl:attribute name="class">termTable</xsl:attribute>
                        <xsl:call-template name="getVariable">
                            <xsl:with-param name="id" select="'Term Annotations'"/>
                        </xsl:call-template>
                    </xsl:element>
                </xsl:element>
                <xsl:apply-templates/>
            </xsl:element>
        </xsl:if>
    </xsl:template>
       
    <xsl:template match="*[contains(@class, ' termentry/termNotation ')]">
        <xsl:element name="tr">
            <!-- Term -->
            <xsl:element name="td">
                <xsl:attribute name="class">termTable</xsl:attribute>
                <xsl:value-of select="*[contains(@class, ' termentry/termVariant ')]"/>
            </xsl:element>
            <!-- Type -->
            <xsl:element name="td">
                <xsl:attribute name="class">termTable</xsl:attribute>
                <xsl:choose>
                    <xsl:when test="contains(@class, ' termentry/fullForm ')">
                        <xsl:call-template name="getVariable">
                            <xsl:with-param name="id" select="'Full Form'"/>
                        </xsl:call-template>
                    </xsl:when>
                    <xsl:when test="contains(@class, ' termentry/abbreviation ')">
                        <xsl:call-template name="getVariable">
                            <xsl:with-param name="id" select="'Abbreviation'"/>
                        </xsl:call-template>
                    </xsl:when>
                    <xsl:when test="contains(@class, ' termentry/acronym ')">
                        <xsl:call-template name="getVariable">
                            <xsl:with-param name="id" select="'Acronym'"/>
                        </xsl:call-template>
                    </xsl:when>
                    <xsl:when test="contains(@class, ' termentry/verb ')">
                        <xsl:call-template name="getVariable">
                            <xsl:with-param name="id" select="'Verb'"/>
                        </xsl:call-template>
                    </xsl:when>
                </xsl:choose>
            </xsl:element>
            <!-- Language -->
            <xsl:element name="td">
                <xsl:attribute name="class">termTable</xsl:attribute>
                <xsl:value-of select="@language"/>
            </xsl:element>
            <!-- Usage -->
            <xsl:element name="td">
                <xsl:attribute name="class">termTable</xsl:attribute>
                <xsl:choose>
                    <xsl:when test="contains(@usage, 'preferred')">
                        <xsl:call-template name="getVariable">
                            <xsl:with-param name="id" select="'Usage Allowed'"/>
                        </xsl:call-template>
                    </xsl:when>
                    <xsl:when test="contains(@usage, 'notRecommended')">
                        <xsl:call-template name="getVariable">
                            <xsl:with-param name="id" select="'Usage Deprecated'"/>
                        </xsl:call-template>
                    </xsl:when>
                </xsl:choose>
            </xsl:element>
            <!-- Source -->
            <xsl:element name="td">
                <xsl:attribute name="class">termTable</xsl:attribute>
                <xsl:apply-templates select="*[contains(@class, ' termentry/termSource ')]"/>
            </xsl:element>
            <!-- Context -->
            <xsl:element name="td">
                <xsl:attribute name="class">termTable</xsl:attribute>
                <xsl:apply-templates select="*[contains(@class, ' termentry/termContext ')]"/>
            </xsl:element>
            <!-- Annotation -->
            <xsl:element name="td">
                <xsl:attribute name="class">termTable</xsl:attribute>
                <xsl:apply-templates select="*[contains(@class, ' termentry/annotation ')]"/>
            </xsl:element>
        </xsl:element>
    </xsl:template>
    
    <xsl:template match="*[contains(@class, ' termentry/sourceName ')]">
        <xsl:value-of select="."/>
    </xsl:template>
    
    <xsl:template match="*[contains(@class, ' termentry/agreedWith ')]">
        <xsl:element name="div">
            <xsl:attribute name="class">termentryDiv</xsl:attribute>
            <xsl:element name="strong">
                <xsl:attribute name="class">termentryLabel</xsl:attribute>
                <xsl:call-template name="getVariable">
                    <xsl:with-param name="id" select="'Agreed With'"/>
                </xsl:call-template>
            </xsl:element>
            <xsl:element name="br"/>
            <xsl:element name="ul">
                <xsl:apply-templates/>    
            </xsl:element>
        </xsl:element>
    </xsl:template>
    
    <xsl:template match="*[contains(@class, ' termentry/termCommitteeMember ')]">
        <xsl:element name="li">
            <xsl:attribute name="class">termCommitteeMember</xsl:attribute>
            <xsl:element name="strong">
                <xsl:attribute name="class">termentryLabel</xsl:attribute>
                <xsl:call-template name="getVariable">
                    <xsl:with-param name="id" select="'Term Committee Member'"/>
                </xsl:call-template>
                <xsl:call-template name="getVariable">
                    <xsl:with-param name="id" select="'Delimiter String'"/>
                </xsl:call-template>
            </xsl:element>
            <xsl:apply-templates/>
        </xsl:element>
    </xsl:template>
    
    <!-- Hypernyms have their own group. -->
    <xsl:template match="*[contains(@class, ' termentry/hypernym ')]" mode="related-links:get-group"
                  name="related-links:group.hypernyms"
                  as="xs:string">
         <xsl:text>hypernym</xsl:text>
    </xsl:template>
    
    <!-- Hyponyms have their own group. -->
    <xsl:template match="*[contains(@class, ' termentry/hyponym ')]" mode="related-links:get-group"
                  name="related-links:group.hyponyms"
                  as="xs:string">
         <xsl:text>hyponym</xsl:text>
    </xsl:template>
    
    <!-- Related Terms have their own group. -->
    <xsl:template match="*[contains(@class, ' termentry/relatedTerm ')]" mode="related-links:get-group"
                  name="related-links:group.relatedTerms"
                  as="xs:string">
         <xsl:text>relatedTerm</xsl:text>
{'fraction_non_alphanumeric': 0.15485988386771019, 'fraction_numerical': 0.0021711688967432467, 'mean_word_length': 1.6036545287235442, 'pattern_counts': {'":': 0, '<': 422, '<?xml version=': 2, '>': 422, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 8}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6781837', 'n_tokens_mistral': 5745, 'n_tokens_neox': 5065, 'n_words': 750}