<commit_before><?xml version="1.0" encoding="UTF-8"?>
<beans

	xmlns="http://www.springframework.org/schema/beans"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:util="http://www.springframework.org/schema/util"
   xmlns:context="http://www.springframework.org/schema/context"
   xmlns:tx="http://www.springframework.org/schema/tx"
   xmlns:aop="http://www.springframework.org/schema/aop"

	xsi:schemaLocation="
		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd
		http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
		http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
	">

	<!-- Enable bean autowiring -->
  <context:annotation-config/>

	<!-- Transaction management -->
  <tx:annotation-driven transaction-manager="transactionManager"/>
  <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
    <property name="dataSource" ref="dataSource"/>
  </bean>

  <!-- database connection configuration -->
  <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" lazy-init="true">
    <property name="location" value="file:${annis.home}/conf/database.properties"/>
    <property name="placeholderPrefix" value="$dao{"/>
  </bean>
	<!-- DataSource -->
  <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource" lazy-init="true">
    <property name="driverClassName" value="$dao{datasource.driver}"/>
    <property name="url" value="$dao{datasource.url}"/>
    <property name="username" value="$dao{datasource.username}"/>
    <property name="password" value="$<PASSWORD>{datasource.password}"/>
  </bean>

	<!-- Helper for weka command -->
  <bean id="wekaHelper" class="annis.WekaHelper" lazy-init="true"/>

	<!-- Helper for list command -->
  <bean id="listCorpusSqlHelper" class="annis.sqlgen.ListCorpusSqlHelper" lazy-init="true"/>

	<!-- Helper for nodeAnnotations command -->
  <bean id="listAnnotationsSqlHelper" class="annis.sqlgen.ListAnnotationsSqlHelper" lazy-init="true"/>

	<!-- Helper for listCorpusAnnotations command -->
  <bean id="listCorpusAnnotationsSqlHelper" class="annis.sqlgen.ListCorpusAnnotationsSqlHelper" lazy-init="true"/>

  <!-- Annis parser -->
  <import resource="classpath:annis/ql/parser/AnnisParser-context.xml"/>

  <bean id="listCorpusByNameDaoHelper" class="annis.dao.ListCorpusByNameDaoHelper" lazy-init="true">
    <property name="requiredType" value="java.lang.Long"/>
  </bean>

  <bean id="defaultJdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate" lazy-init="true">
    <property name="dataSource" ref="dataSource"/>
    <property name="fetchSize" value="0"/>
  </bean>

  <bean id="metaDataFilter" class="annis.dao.MetaDataFilter" lazy-init="true">
    <property name="jdbcTemplate" ref="defaultJdbcTemplate" />
		<!--<property name="dataSource" ref="dataSource"/>-->
    <property name="subQueryCorpusSelectionStrategy" ref="subQueryCorpusSelectionStrategy" />
  </bean>

  <bean id="byteHelper" class="annis.sqlgen.ByteHelper" lazy-init="true" />
  <bean id="metaByteHelper" class="annis.sqlgen.MetaByteHelper" lazy-init="true" />

  <bean id="sqlScriptSessionModifierBase" class="annis.dao.ScriptFileSqlSessionModifier" lazy-init="true">
    <property name="scriptFile" value="modify_session.sql"/>
    
    <!-- missing: administrationDao -->
  </bean>

   <!-- BEGIN EXPORTS -->

	<!-- exported bean: AnnisDao -->
  <bean id="annisDao" class="annis.dao.SpringAnnisDao" init-method="init" lazy-init="true">

    <!-- configuration -->
    <property name="timeout" value="${annis.sql-timeout}"/>

    <property name="countSqlGenerator" ref="countSqlGenerator"/>
    <property name="countMatchesAndDocumentsSqlGenerator" ref="countMatchesAndDocumentsSqlGenerator"/>
    <property name="annotateSqlGenerator" ref="annotateSqlGenerator"/>
    <property name="saltAnnotateExtractor" ref="saltAnnotateExtractor"/>
    <property name="matrixSqlGenerator" ref="matrixSqlGenerator"/>
    <property name="graphSqlGenerator" ref="graphSqlGenerator" />

    <property name="dataSource" ref="dataSource"/>

    <property name="aqlParser" ref="annisParser"/>
    <property name="sqlGenerator" ref="findSqlGenerator"/>

    <property name="listCorpusSqlHelper" ref="listCorpusSqlHelper"/>
    <property name="listAnnotationsSqlHelper" ref="listAnnotationsSqlHelper"/>
    <property name="listCorpusAnnotationsSqlHelper" ref="listCorpusAnnotationsSqlHelper"/>

    <property name="queryAnalysis" ref="aqlAnalysis"/>
    <property name="findSqlGenerator" ref="findSqlGenerator"/>
    <property name="sqlSessionModifiers">
      <util:list>
        <ref bean="annisDao"/>
        <ref bean="sqlScriptSessionModifier"/>
      </util:list>
    </property>

    <property name="listCorpusByNameDaoHelper" ref="listCorpusByNameDaoHelper"/>
    
    <property name="metaDataFilter" ref="metaDataFilter" />
    <property name="byteHelper" ref="byteHelper" />
    <property name="metaByteHelper" ref="metaByteHelper" />

  </bean>

	<!-- base bean for exported Database API for administration tasks -->
  <bean id="administrationDaoBase" class="annis.administration.DefaultAdministrationDao" init-method="init" lazy-init="true">
    <property name="scriptPath" value="${annis.script-path}"/>
    <property name="externalFilesPath" value="${annis.external-data-path}"/>
    <property name="temporaryStagingArea" value="${annis.import.temporary-staging-area}" />
    <property name="dbLayout" value="${annis.mode}" />
    <property name="dataSource" ref="dataSource" />
    <property name="mimeTypeMapping">
      <util:map>
        <entry key="webm" value="video/webm"/>
        <entry key="ogg" value="audio/ogg"/>
        <entry key="wav" value="audio/wav"/>
        <entry key="mp3" value="audio/mpeg"/>
        <entry key="pdf" value="application/pdf"/>
      </util:map>
    </property>
    <property name="tableInsertFrom">
      <util:map>
        <entry key="resolver_vis_map" value="corpus, version, namespace, element, vis_type, display_name, visibility::resolver_visibility, &quot;order&quot;, mappings" />
      </util:map>
    </property>
    <property name="tableInsertSelect">
      <util:map>
        <entry key="resolver_vis_map" value="corpus, version, namespace, element, vis_type, display_name, visibility, &quot;order&quot;, mappings" />
        <entry key="text" value="corpus_ref, id, name, text" />
      </util:map>
    </property>
  </bean>

  <!-- END EXPORTS -->

</beans><commit_msg>also copy toplevel corpus (otherwise we can't delete it later)<commit_after><?xml version="1.0" encoding="UTF-8"?>
<beans

	xmlns="http://www.springframework.org/schema/beans"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:util="http://www.springframework.org/schema/util"
   xmlns:context="http://www.springframework.org/schema/context"
   xmlns:tx="http://www.springframework.org/schema/tx"
   xmlns:aop="http://www.springframework.org/schema/aop"

	xsi:schemaLocation="
		http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd
		http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
		http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
	">

	<!-- Enable bean autowiring -->
  <context:annotation-config/>

	<!-- Transaction management -->
  <tx:annotation-driven transaction-manager="transactionManager"/>
  <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
    <property name="dataSource" ref="dataSource"/>
  </bean>

  <!-- database connection configuration -->
  <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer" lazy-init="true">
    <property name="location" value="file:${annis.home}/conf/database.properties"/>
    <property name="placeholderPrefix" value="$dao{"/>
  </bean>
	<!-- DataSource -->
  <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource" lazy-init="true">
    <property name="driverClassName" value="$dao{datasource.driver}"/>
    <property name="url" value="$dao{datasource.url}"/>
    <property name="username" value="$dao{datasource.username}"/>
    <property name="password" value="$dao{datasource.password}"/>
  </bean>

	<!-- Helper for weka command -->
  <bean id="wekaHelper" class="annis.WekaHelper" lazy-init="true"/>

	<!-- Helper for list command -->
  <bean id="listCorpusSqlHelper" class="annis.sqlgen.ListCorpusSqlHelper" lazy-init="true"/>

	<!-- Helper for nodeAnnotations command -->
  <bean id="listAnnotationsSqlHelper" class="annis.sqlgen.ListAnnotationsSqlHelper" lazy-init="true"/>

	<!-- Helper for listCorpusAnnotations command -->
  <bean id="listCorpusAnnotationsSqlHelper" class="annis.sqlgen.ListCorpusAnnotationsSqlHelper" lazy-init="true"/>

  <!-- Annis parser -->
  <import resource="classpath:annis/ql/parser/AnnisParser-context.xml"/>

  <bean id="listCorpusByNameDaoHelper" class="annis.dao.ListCorpusByNameDaoHelper" lazy-init="true">
    <property name="requiredType" value="java.lang.Long"/>
  </bean>

  <bean id="defaultJdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate" lazy-init="true">
    <property name="dataSource" ref="dataSource"/>
    <property name="fetchSize" value="0"/>
  </bean>

  <bean id="metaDataFilter" class="annis.dao.MetaDataFilter" lazy-init="true">
    <property name="jdbcTemplate" ref="defaultJdbcTemplate" />
		<!--<property name="dataSource" ref="dataSource"/>-->
    <property name="subQueryCorpusSelectionStrategy" ref="subQueryCorpusSelectionStrategy" />
  </bean>

  <bean id="byteHelper" class="annis.sqlgen.ByteHelper" lazy-init="true" />
  <bean id="metaByteHelper" class="annis.sqlgen.MetaByteHelper" lazy-init="true" />

  <bean id="sqlScriptSessionModifierBase" class="annis.dao.ScriptFileSqlSessionModifier" lazy-init="true">
    <property name="scriptFile" value="modify_session.sql"/>
    
    <!-- missing: administrationDao -->
  </bean>

   <!-- BEGIN EXPORTS -->

	<!-- exported bean: AnnisDao -->
  <bean id="annisDao" class="annis.dao.SpringAnnisDao" init-method="init" lazy-init="true">

    <!-- configuration -->
    <property name="timeout" value="${annis.sql-timeout}"/>

    <property name="countSqlGenerator" ref="countSqlGenerator"/>
    <property name="countMatchesAndDocumentsSqlGenerator" ref="countMatchesAndDocumentsSqlGenerator"/>
    <property name="annotateSqlGenerator" ref="annotateSqlGenerator"/>
    <property name="saltAnnotateExtractor" ref="saltAnnotateExtractor"/>
    <property name="matrixSqlGenerator" ref="matrixSqlGenerator"/>
    <property name="graphSqlGenerator" ref="graphSqlGenerator" />

    <property name="dataSource" ref="dataSource"/>

    <property name="aqlParser" ref="annisParser"/>
    <property name="sqlGenerator" ref="findSqlGenerator"/>

    <property name="listCorpusSqlHelper" ref="listCorpusSqlHelper"/>
    <property name="listAnnotationsSqlHelper" ref="listAnnotationsSqlHelper"/>
    <property name="listCorpusAnnotationsSqlHelper" ref="listCorpusAnnotationsSqlHelper"/>

    <property name="queryAnalysis" ref="aqlAnalysis"/>
    <property name="findSqlGenerator" ref="findSqlGenerator"/>
    <property name="sqlSessionModifiers">
      <util:list>
        <ref bean="annisDao"/>
        <ref bean="sqlScriptSessionModifier"/>
      </util:list>
    </property>

    <property name="listCorpusByNameDaoHelper" ref="listCorpusByNameDaoHelper"/>
    
    <property name="metaDataFilter" ref="metaDataFilter" />
    <property name="byteHelper" ref="byteHelper" />
    <property name="metaByteHelper" ref="metaByteHelper" />

  </bean>

	<!-- base bean for exported Database API for administration tasks -->
  <bean id="administrationDaoBase" class="annis.administration.DefaultAdministrationDao" init-method="init" lazy-init="true">
    <property name="scriptPath" value="${annis.script-path}"/>
    <property name="externalFilesPath" value="${annis.external-data-path}"/>
    <property name="temporaryStagingArea" value="${annis.import.temporary-staging-area}" />
    <property name="dbLayout" value="${annis.mode}" />
    <property name="dataSource" ref="dataSource" />
    <property name="mimeTypeMapping">
      <util:map>
        <entry key="webm" value="video/webm"/>
        <entry key="ogg" value="audio/ogg"/>
        <entry key="wav" value="audio/wav"/>
        <entry key="mp3" value="audio/mpeg"/>
        <entry key="pdf" value="application/pdf"/>
      </util:map>
    </property>
    <property name="tableInsertFrom">
      <util:map>
        <entry key="resolver_vis_map" value="corpus, version, namespace, element, vis_type, display_name, visibility::resolver_visibility, &quot;order&quot;, mappings" />
      </util:map>
    </property>
    <property name="tableInsertSelect">
      <util:map>
        <entry key="resolver_vis_map" value="corpus, version, namespace, element, vis_type, display_name, visibility, &quot;order&quot;, mappings" />
        <entry key="text" value="corpus_ref, id, name, text, toplevel_corpus" />
      </util:map>
    </property>
  </bean>

  <!-- END EXPORTS -->

</beans>
{'fraction_non_alphanumeric': 0.16754990925589835, 'fraction_numerical': 0.0026134301270417425, 'mean_word_length': 4.839762611275964, 'pattern_counts': {'":': 0, '<': 224, '<?xml version=': 2, '>': 224, 'https://': 0, 'lorem ipsum': 0, 'www.': 32, 'xml': 16}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3631533', 'n_tokens_mistral': 4204, 'n_tokens_neox': 4124, 'n_words': 655}