<commit_before><?xml version='1.0' encoding='UTF-8'?><!-- -*- indent-tabs-mode: nil -*- -->
<!--
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option) any
later version.

This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
details.

You should have received a copy of the GNU Lesser General Public License
along with this program; see the file COPYING.LGPL.  If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:db="http://docbook.org/ns/docbook"
                xmlns:set="http://exslt.org/sets"
                xmlns:exsl="http://exslt.org/common"
                extension-element-prefixes="exsl"
                exclude-result-prefixes="db set"
                version="1.0">

<!--!!==========================================================================
DocBook Chunking

REMARK: Describe this module
-->


<!--@@==========================================================================
db.chunk.chunks
A space-seperated list of the names of elements that should be chunked

REMARK: This parameter sucks
-->
<xsl:param name="db.chunk.chunks" select="
           'appendix    article     bibliography  bibliodiv  book    chapter
            colophon    dedication  glossary      glossdiv   index
            lot         part        preface       refentry   reference
            sect1       sect2       sect3         sect4      sect5
            section     setindex    simplesect    toc'"/>
<xsl:variable name="db.chunk.chunks_" select="concat(' ', $db.chunk.chunks, ' ')"/>


<!--@@==========================================================================
db.chunk.max_depth
The maximum depth for chunking sections

REMARK: Describe what this does
-->
<xsl:param name="db.chunk.max_depth">
  <xsl:choose>
    <xsl:when test="number(processing-instruction('db.chunk.max_depth'))">
      <xsl:value-of
       select="number(processing-instruction('db.chunk.max_depth'))"/>
    </xsl:when>
    <xsl:when test="/book | /db:book">
      <xsl:value-of select="2"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="1"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:param>


<!--@@==========================================================================
db.chunk.basename
The base filename of the output file, without an extension

REMARK: Describe what this does
-->
<xsl:param name="db.chunk.basename" select="/*/@id | /*/@xml:id"/>


<!--@@==========================================================================
db.chunk.extension
The default file extension for new output documents

REMARK: Describe what this does
-->
<xsl:param name="db.chunk.extension"/>


<!--@@==========================================================================
db.chunk.info_chunk
Whether to create a chunk for the title page

REMARK: Describe what this does
-->
<xsl:param name="db.chunk.info_chunk" select="$db.chunk.max_depth != 0"/>


<!--@@==========================================================================
db.chunk.info_basename
The base filename for the title page

REMARK: Describe what this does
-->
<xsl:param name="db.chunk.info_basename"><commit_msg>db-chunk: Default db.chunk.basename to 'index' without @id<commit_after><?xml version='1.0' encoding='UTF-8'?><!-- -*- indent-tabs-mode: nil -*- -->
<!--
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option) any
later version.

This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
details.

You should have received a copy of the GNU Lesser General Public License
along with this program; see the file COPYING.LGPL.  If not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:db="http://docbook.org/ns/docbook"
                xmlns:set="http://exslt.org/sets"
                xmlns:exsl="http://exslt.org/common"
                extension-element-prefixes="exsl"
                exclude-result-prefixes="db set"
                version="1.0">

<!--!!==========================================================================
DocBook Chunking

REMARK: Describe this module
-->


<!--@@==========================================================================
db.chunk.chunks
A space-seperated list of the names of elements that should be chunked

REMARK: This parameter sucks
-->
<xsl:param name="db.chunk.chunks" select="
           'appendix    article     bibliography  bibliodiv  book    chapter
            colophon    dedication  glossary      glossdiv   index
            lot         part        preface       refentry   reference
            sect1       sect2       sect3         sect4      sect5
            section     setindex    simplesect    toc'"/>
<xsl:variable name="db.chunk.chunks_" select="concat(' ', $db.chunk.chunks, ' ')"/>


<!--@@==========================================================================
db.chunk.max_depth
The maximum depth for chunking sections

REMARK: Describe what this does
-->
<xsl:param name="db.chunk.max_depth">
  <xsl:choose>
    <xsl:when test="number(processing-instruction('db.chunk.max_depth'))">
      <xsl:value-of
       select="number(processing-instruction('db.chunk.max_depth'))"/>
    </xsl:when>
    <xsl:when test="/book | /db:book">
      <xsl:value-of select="2"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="1"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:param>


<!--@@==========================================================================
db.chunk.basename
The base filename of the output file, without an extension

REMARK: Describe what this does
-->
<xsl:param name="db.chunk.basename">
  <xsl:choose>
    <xsl:when test="/*/@xml:id">
      <xsl:value-of select="/*/@xml:id"/>
    </xsl:when>
    <xsl:when test="/*/@id">
      <xsl:value-of select="/*/@id"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:text>index</xsl:text>
    </xsl:otherwise>
  </xsl:choose>
</xsl:param>


<!--@@==========================================================================
db.chunk.extension
The default file extension for new output documents

REMARK: Describe what this does
-->
<xsl:param name="db.chunk.extension"/>


<!--@@==========================================================================
db.chunk.info_chunk
Whether to create a chunk for the title page

REMARK: Describe what this does
-->
<xsl:param name="db.chunk.info_chunk" select="$db.chunk.max_depth != 0"/>


<!--@@==========================================================================
db.chunk.info_basename
The base filename for the title page

REMARK: Describe what this does
-->
<xsl:param name="db.chunk.info_basename">
{'fraction_non_alphanumeric': 0.2525130679533575, 'fraction_numerical': 0.008845999195818254, 'mean_word_length': 3.617574257425743, 'pattern_counts': {'":': 0, '<': 76, '<?xml version=': 2, '>': 76, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 13}, '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': '2209951', 'n_tokens_mistral': 2132, 'n_tokens_neox': 1945, 'n_words': 601}