<commit_before>package com.softmotions.ncms.asm;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;

import org.apache.commons.configuration2.HierarchicalConfiguration;
import org.apache.commons.configuration2.tree.ImmutableNode;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.inject.AbstractModule;
import com.google.inject.Inject;
import com.google.inject.Injector;
import com.google.inject.Singleton;
import com.google.inject.assistedinject.FactoryModuleBuilder;
import com.google.inject.multibindings.Multibinder;
import com.softmotions.ncms.NcmsEnvironment;
import com.softmotions.ncms.asm.am.*;
import com.softmotions.ncms.asm.render.AsmRenderer;
import com.softmotions.ncms.asm.render.AsmRendererContext;
import com.softmotions.ncms.asm.render.AsmRendererContextFactory;
import com.softmotions.ncms.asm.render.AsmRendererContextImpl;
import com.softmotions.ncms.asm.render.AsmResourceLoader;
import com.softmotions.ncms.asm.render.DefaultAsmRenderer;
import com.softmotions.ncms.asm.render.ldrs.AsmClasspathResourceLoader;
import com.softmotions.ncms.media.MediaResource;

/**
 * @author <NAME> (<EMAIL>)
 */
public class AsmModule extends AbstractModule {

    private static final Logger log = LoggerFactory.getLogger(AsmModule.class);

    @Override
    protected void configure() {

        install(new FactoryModuleBuilder()
                        .implement(AsmRendererContext.class, AsmRendererContextImpl.class)
                        .build(AsmRendererContextFactory.class));

        Multibinder<AsmAttributeManager> attrBinder =
                Multibinder.newSetBinder(binder(), AsmAttributeManager.class);
        attrBinder.addBinding().to(AsmStringAM.class);
        attrBinder.addBinding().to(AsmRefAM.class);
        attrBinder.addBinding().to(AsmWebRefAM.class);
        attrBinder.addBinding().to(AsmSelectAM.class);
        attrBinder.addBinding().to(AsmBooleanAM.class);
        attrBinder.addBinding().to(AsmTreeAM.class);
        attrBinder.addBinding().to(AsmWikiAM.class);
        attrBinder.addBinding().to(AsmImageAM.class);
        attrBinder.addBinding().to(AsmFileRefAM.class);
        attrBinder.addBinding().to(AsmPageRefAM.class);
        attrBinder.addBinding().to(AsmBreadCrumbsAM.class);
        attrBinder.addBinding().to(AsmMainPageAM.class);
        attrBinder.addBinding().to(AsmRichRefAM.class);
        attrBinder.addBinding().to(AsmDateAM.class);
        attrBinder.addBinding().to(AsmBumpOrdinalAM.class);
        attrBinder.addBinding().to(AsmMedialineAM.class);
        attrBinder.addBinding().to(AsmAliasAM.class);
        attrBinder.addBinding().to(AsmCoreAM.class);


        //Resource loader
        bind(AsmResourceLoader.class).to(AsmResourceLoaderImpl.class).in(Singleton.class);
        bind(AsmEventsListener.class).asEagerSingleton();

        bind(AsmDAO.class);
        bind(AsmRenderer.class).to(DefaultAsmRenderer.class);

        //todo review registration
        //bind(AsmTreeAM.class).in(Singleton.class);
        bind(AsmAttributeManagersRegistry.class).to(DefaultAsmAttributeManagersRegistry.class).in(Singleton.class);
        bind(PageSecurityService.class).in(Singleton.class);
        bind(PageService.class).to(PageRS.class);
<commit_msg>- attributes synchronization fix<commit_after>package com.softmotions.ncms.asm;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;

import org.apache.commons.configuration2.HierarchicalConfiguration;
import org.apache.commons.configuration2.tree.ImmutableNode;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.inject.AbstractModule;
import com.google.inject.Inject;
import com.google.inject.Injector;
import com.google.inject.Singleton;
import com.google.inject.assistedinject.FactoryModuleBuilder;
import com.google.inject.multibindings.Multibinder;
import com.softmotions.ncms.NcmsEnvironment;
import com.softmotions.ncms.asm.am.*;
import com.softmotions.ncms.asm.render.AsmRenderer;
import com.softmotions.ncms.asm.render.AsmRendererContext;
import com.softmotions.ncms.asm.render.AsmRendererContextFactory;
import com.softmotions.ncms.asm.render.AsmRendererContextImpl;
import com.softmotions.ncms.asm.render.AsmResourceLoader;
import com.softmotions.ncms.asm.render.DefaultAsmRenderer;
import com.softmotions.ncms.asm.render.ldrs.AsmClasspathResourceLoader;
import com.softmotions.ncms.media.MediaResource;

/**
 * @author <NAME> (<EMAIL>)
 */
public class AsmModule extends AbstractModule {

    private static final Logger log = LoggerFactory.getLogger(AsmModule.class);

    @Override
    protected void configure() {

        install(new FactoryModuleBuilder()
                        .implement(AsmRendererContext.class, AsmRendererContextImpl.class)
                        .build(AsmRendererContextFactory.class));

        Multibinder<AsmAttributeManager> attrBinder =
                Multibinder.newSetBinder(binder(), AsmAttributeManager.class);
        attrBinder.addBinding().to(AsmStringAM.class);
        attrBinder.addBinding().to(AsmRefAM.class);
        attrBinder.addBinding().to(AsmWebRefAM.class);
        attrBinder.addBinding().to(AsmSelectAM.class);
        attrBinder.addBinding().to(AsmBooleanAM.class);
        attrBinder.addBinding().to(AsmTreeAM.class);
        attrBinder.addBinding().to(AsmWikiAM.class);
        attrBinder.addBinding().to(AsmImageAM.class);
        attrBinder.addBinding().to(AsmFileRefAM.class);
        attrBinder.addBinding().to(AsmPageRefAM.class);
        attrBinder.addBinding().to(AsmBreadCrumbsAM.class);
        attrBinder.addBinding().to(AsmMainPageAM.class);
        attrBinder.addBinding().to(AsmRichRefAM.class);
        attrBinder.addBinding().to(AsmDateAM.class);
        attrBinder.addBinding().to(AsmBumpOrdinalAM.class);
        attrBinder.addBinding().to(AsmMedialineAM.class);
        attrBinder.addBinding().to(AsmAliasAM.class);
        attrBinder.addBinding().to(AsmCoreAM.class);


        //Resource loader
        bind(AsmResourceLoader.class).to(AsmResourceLoaderImpl.class).in(Singleton.class);
        bind(AsmEventsListener.class).asEagerSingleton();

        bind(AsmDAO.class);
        bind(AsmRenderer.class).to(DefaultAsmRenderer.class);

        bind(AsmAttributeManagersRegistry.class).to(DefaultAsmAttributeManagersRegistry.class).in(Singleton.class);
        bind(PageSecurityService.class).in(Singleton.class);
        bind(PageService.class).to(PageRS.class);

{'fraction_non_alphanumeric': 0.11686764924817628, 'fraction_numerical': 0.001786511835640911, 'mean_word_length': 4.298107255520505, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '4048385', 'n_tokens_mistral': 2113, 'n_tokens_neox': 2088, 'n_words': 223}