<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"
       xsi:schemaLocation="
       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">

    <bean id="processorFactory" class="org.opens.tanaguru.processor.ProcessorFactoryImpl"/>

    <bean id="processorService" class="org.opens.tanaguru.service.ProcessorServiceImpl">
        <property name="ruleImplementationLoaderService" ref="ruleImplementationLoaderService"/>

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

        <property name="processRemarkFactory" ref="processRemarkFactory"/>
        <property name="sourceCodeRemarkFactory" ref="sourceCodeRemarkFactory"/>
        <property name="evidenceDataService" ref="evidenceDataService"/>
        <property name="evidenceElementFactory" ref="evidenceElementFactory"/>

        <property name="processorFactory" ref="processorFactory"/>
        <property name="urlIdentifierFactory" ref="urlIdentifierFactory"/>
    </bean>

    <bean id="imageChecker" class="org.opens.tanaguru.ruleimplementation.ImageChecker" factory-method="getInstance"/>

    <bean id="languageDetector" class="org.opens.tanaguru.ruleimplementation.LanguageDetector" factory-method="getInstance"/>

    <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
        <property name="targetObject">
            <ref local="languageDetector"/>
        </property>
        <property name="targetMethod">
            <value>setServiceUrl</value>
        </property>
        <property name="arguments">
            <list>
                <value>${service-url}</value>
            </list>
        </property>
    </bean>

    <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
        <property name="targetObject">
            <ref local="languageDetector"/>
        </property>
        <property name="targetMethod">
            <value>setVersion</value>
        </property>
        <property name="arguments">
            <list>
                <value>${detector-version}</value>
            </list>
        </property>
    </bean>

    <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
        <property name="targetObject">
            <ref local="languageDetector"/>
        </property>
        <property name="targetMethod">
            <value>setUserKey</value>
        </property>
        <property name="arguments">
            <list>
                <value>${user-key}</value>
            </list>
        </property>
    </bean>

    <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
        <property name="targetObject">
            <ref local="languageDetector"/>
        </property>
        <property name="targetMethod">
            <value>setTextKey</value>
        </property>
        <property name="arguments">
            <list>
                <value>${text-key}</value>
            </list>
        </property>
    </bean>

    <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
        <property name="targetObject">
            <ref local="languageDetector"/>
        </property>
        <property name="targetMethod">
            <value>setRefererKey</value>
        </property>
        <property name="arguments">
            <list>
                <value>${referer-key}</value>
            </list>
        </property>
    </bean>

    <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
        <property name="targetObject">
            <ref local="languageDetector"/>
        </property>
        <property name="targetMethod">
            <value>setRefererValue</value>
        </property>
        <property name="arguments">
            <list>
                <value>${referer-value}</value>
            </list>
        </property>
    </bean>

</beans>
<commit_msg>Bug #252 : AW21 8.4.1 implement new web service for language detection (replacement of Google)<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"
       xsi:schemaLocation="
       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">

    <bean id="processorFactory" class="org.opens.tanaguru.processor.ProcessorFactoryImpl"/>

    <bean id="processorService" class="org.opens.tanaguru.service.ProcessorServiceImpl">
        <property name="ruleImplementationLoaderService" ref="ruleImplementationLoaderService"/>

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

        <property name="processRemarkFactory" ref="processRemarkFactory"/>
        <property name="sourceCodeRemarkFactory" ref="sourceCodeRemarkFactory"/>
        <property name="evidenceDataService" ref="evidenceDataService"/>
        <property name="evidenceElementFactory" ref="evidenceElementFactory"/>

        <property name="processorFactory" ref="processorFactory"/>
        <property name="urlIdentifierFactory" ref="urlIdentifierFactory"/>
    </bean>

    <bean id="imageChecker" class="org.opens.tanaguru.ruleimplementation.ImageChecker" factory-method="getInstance"/>

    <bean id="languageDetector" class="org.opens.tanaguru.ruleimplementation.LanguageDetector" factory-method="getInstance"/>

    <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
        <property name="targetObject">
            <ref local="languageDetector"/>
        </property>
        <property name="targetMethod">
            <value>setServiceUrl</value>
        </property>
        <property name="arguments">
            <list>
                <value>${service-url}</value>
            </list>
        </property>
    </bean>

    <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
        <property name="targetObject">
            <ref local="languageDetector"/>
        </property>
        <property name="targetMethod">
            <value>setVersion</value>
        </property>
        <property name="arguments">
            <list>
                <value>${detector-version}</value>
            </list>
        </property>
    </bean>

    <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
        <property name="targetObject">
            <ref local="languageDetector"/>
        </property>
        <property name="targetMethod">
            <value>setTextKey</value>
        </property>
        <property name="arguments">
            <list>
                <value>${text-key}</value>
            </list>
        </property>
    </bean>

    <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
        <property name="targetObject">
            <ref local="languageDetector"/>
        </property>
        <property name="targetMethod">
            <value>setProxyHost</value>
        </property>
        <property name="arguments">
            <list>
                <value>${proxyHost}</value>
            </list>
        </property>
    </bean>

    <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
        <property name="targetObject">
            <ref local="languageDetector"/>
        </property>
        <property name="targetMethod">
            <value>setProxyPort</value>
        </property>
        <property name="arguments">
            <list>
                <value>${proxyPort}</value>
            </list>
        </property>
    </bean>

</beans>

{'fraction_non_alphanumeric': 0.1394391561615642, 'fraction_numerical': 0.0036017494211474143, 'mean_word_length': 2.6196461824953445, 'pattern_counts': {'":': 0, '<': 200, '<?xml version=': 2, '>': 200, 'https://': 0, 'lorem ipsum': 0, 'www.': 8, 'xml': 6}, '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': '5109789', 'n_tokens_mistral': 2057, 'n_tokens_neox': 1989, 'n_words': 309}