<commit_before>package org.xbib.elasticsearch.plugin.bundle;

import org.apache.lucene.analysis.Analyzer;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.node.DiscoveryNodes;
import org.elasticsearch.common.component.LifecycleComponent;
import org.elasticsearch.common.inject.Module;
import org.elasticsearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.IndexScopedSettings;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.SettingsFilter;
import org.elasticsearch.index.analysis.AnalyzerProvider;
import org.elasticsearch.index.analysis.CharFilterFactory;
import org.elasticsearch.index.analysis.TokenFilterFactory;
import org.elasticsearch.index.analysis.TokenizerFactory;
import org.elasticsearch.index.mapper.Mapper;
import org.elasticsearch.indices.analysis.AnalysisModule;
import org.elasticsearch.plugins.ActionPlugin;
import org.elasticsearch.plugins.AnalysisPlugin;
import org.elasticsearch.plugins.MapperPlugin;
import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.rest.RestController;
import org.elasticsearch.rest.RestHandler;
import org.xbib.elasticsearch.action.isbnformat.ISBNFormatAction;
import org.xbib.elasticsearch.action.isbnformat.TransportISBNFormatAction;
import org.xbib.elasticsearch.action.langdetect.LangdetectAction;
import org.xbib.elasticsearch.action.langdetect.TransportLangdetectAction;
import org.xbib.elasticsearch.index.analysis.autophrase.AutoPhrasingTokenFilterFactory;
import org.xbib.elasticsearch.index.analysis.baseform.BaseformTokenFilterFactory;
import org.xbib.elasticsearch.index.analysis.concat.ConcatTokenFilterFactory;
import org.xbib.elasticsearch.index.analysis.concat.PairTokenFilterFactory;
import org.xbib.elasticsearch.index.analysis.decompound.patricia.DecompoundTokenFilterFactory;
import org.xbib.elasticsearch.index.analysis.decompound.fst.FstDecompoundTokenFilterFactory;
import org.xbib.elasticsearch.index.analysis.lemmatize.LemmatizeTokenFilterFactory;
import org.xbib.elasticsearch.index.analysis.german.GermanNormalizationFilterFactory;
import org.xbib.elasticsearch.index.analysis.hyphen.HyphenAnalyzerProvider;
import org.xbib.elasticsearch.index.analysis.hyphen.HyphenTokenFilterFactory;
import org.xbib.elasticsearch.index.analysis.hyphen.HyphenTokenizerFactory;
import org.xbib.elasticsearch.index.analysis.icu.IcuCollationKeyAnalyzerProvider;
import org.xbib.elasticsearch.index.analysis.icu.IcuCollationTokenizerFactory;
import org.xbib.elasticsearch.index.analysis.icu.IcuFoldingCharFilterFactory;
import org.xbib.elasticsearch.index.analysis.icu.IcuFoldingTokenFilterFactory;
import org.xbib.elasticsearch.index.analysis.icu.IcuNormalizerCharFilterFactory;
import org.xbib.elasticsearch.index.analysis.icu.IcuNormalizerTokenFilterFactory;
import org.xbib.elasticsearch.index.analysis.icu.IcuNumberFormatTokenFilterFactory;
import org.xbib.elasticsearch.index.analysis.icu.IcuTransformTokenFilterFactory;
import org.xbib.elasticsearch.index.analysis.icu.segmentation.IcuTokenizerFactory;
import org.xbib.elasticsearch.index.analysis.naturalsort.NaturalSortKeyAnalyzerProvider;
import org.xbib.elasticsearch.index.analysis.naturalsort.NaturalSortKeyTokenizerFactory;
import org.xbib.elasticsearch.index.analysis.sortform.SortformAnalyzerProvider;
import org.xbib.elasticsearch.index.analysis.sortform.SortformTokenFilterFactory;
import org.xbib.elasticsearch.index.analysis.standardnumber.StandardnumberAnalyzerProvider;
import org.xbib.elasticsearch.index.analysis.standardnumber.StandardnumberTokenFilterFactory;
import org.xbib.elasticsearch.index.analysis.symbolname.SymbolnameTokenFilterFactory;
import org.xbib.elasticsearch.index.analysis.worddelimiter.WordDelimiterFilter2Factory;
import org.xbib.elasticsearch.index.analysis.worddelimiter.WordDelimiterFilterFactory;
import org.xbib.elasticsearch.index.analysis.year.GregorianYearTokenFilterFactory;
import org.xbib.elasticsearch.index.mapper.crypt.CryptMapper;
import org.xbib.elasticsearch.index.mapper.langdetect.LangdetectMapper;
import org.xbib.elasticsearch.index.mapper.reference.ReferenceMapper;
import org.xbib.elasticsearch.index.mapper.reference.ReferenceMapperModule;
import org.xbib.elasticsearch.index.mapper.reference.ReferenceMapperTypeParser;
import org.xbib.elasticsearch.common.reference.ReferenceService;
import org.xbib.elasticsearch.index.mapper.standardnumber.StandardnumberMapper;
import org.xbib.elasticsearch.index.mapper.standardnumber.StandardnumberMapperModule;
import org.xbib.elasticsearch.index.mapper.standardnumber.StandardnumberMapperTypeParser;
import org.xbib.elasticsearch.common.standardnumber.StandardnumberService;
import org.xbib.elasticsearch.rest.action.isbnformat.RestISBNFormatterAction;
import org.xbib.elasticsearch.rest.action.langdetect.RestLangdetectAction;

import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Supplier;

/**
 *
 */
public class BundlePlugin extends Plugin implements AnalysisPlugin, MapperPlugin, ActionPlugin {

    private static final StandardnumberMapperTypeParser standardNumberTypeParser =
            new StandardnumberMapperTypeParser();

    private static final ReferenceMapperTypeParser referenceMapperTypeParser =
            new ReferenceMapperTypeParser();

    private final Settings settings;

    public BundlePlugin(Settings settings) {
        this.settings = settings;
    }
<commit_msg>register setting plugins.xbib.icu.enabled via getSettings()<commit_after>package org.xbib.elasticsearch.plugin.bundle;

import org.apache.lucene.analysis.Analyzer;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.cluster.metadata.IndexNameExpressionResolver;
import org.elasticsearch.cluster.node.DiscoveryNodes;
import org.elasticsearch.common.component.LifecycleComponent;
import org.elasticsearch.common.inject.Module;
import org.elasticsearch.common.settings.ClusterSettings;
import org.elasticsearch.common.settings.IndexScopedSettings;
import org.elasticsearch.common.settings.Setting;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.settings.SettingsFilter;
import org.elasticsearch.index.analysis.AnalyzerProvider;
import org.elasticsearch.index.analysis.CharFilterFactory;
import org.elasticsearch.index.analysis.TokenFilterFactory;
import org.elasticsearch.index.analysis.TokenizerFactory;
import org.elasticsearch.index.mapper.Mapper;
import org.elasticsearch.indices.analysis.AnalysisModule;
import org.elasticsearch.plugins.ActionPlugin;
import org.elasticsearch.plugins.AnalysisPlugin;
import org.elasticsearch.plugins.MapperPlugin;
import org.elasticsearch.plugins.Plugin;
import org.elasticsearch.rest.RestController;
import org.elasticsearch.rest.RestHandler;
import org.xbib.elasticsearch.action.isbnformat.ISBNFormatAction;
import org.xbib.elasticsearch.action.isbnformat.TransportISBNFormatAction;
import org.xbib.elasticsearch.action.langdetect.LangdetectAction;
import org.xbib.elasticsearch.action.langdetect.TransportLangdetectAction;
import org.xbib.elasticsearch.index.analysis.autophrase.AutoPhrasingTokenFilterFactory;
import org.xbib.elasticsearch.index.analysis.baseform.BaseformTokenFilterFactory;
import org.xbib.elasticsearch.index.analysis.concat.ConcatTokenFilterFactory;
import org.xbib.elasticsearch.index.analysis.concat.PairTokenFilterFactory;
import org.xbib.elasticsearch.index.analysis.decompound.patricia.DecompoundTokenFilterFactory;
import org.xbib.elasticsearch.index.analysis.decompound.fst.FstDecompoundTokenFilterFactory;
import org.xbib.elasticsearch.index.analysis.lemmatize.LemmatizeTokenFilterFactory;
import org.xbib.elasticsearch.index.analysis.german.GermanNormalizationFilterFactory;
import org.xbib.elasticsearch.index.analysis.hyphen.HyphenAnalyzerProvider;
import org.xbib.elasticsearch.index.analysis.hyphen.HyphenTokenFilterFactory;
import org.xbib.elasticsearch.index.analysis.hyphen.HyphenTokenizerFactory;
import org.xbib.elasticsearch.index.analysis.icu.IcuCollationKeyAnalyzerProvider;
import org.xbib.elasticsearch.index.analysis.icu.IcuCollationTokenizerFactory;
import org.xbib.elasticsearch.index.analysis.icu.IcuFoldingCharFilterFactory;
import org.xbib.elasticsearch.index.analysis.icu.IcuFoldingTokenFilterFactory;
import org.xbib.elasticsearch.index.analysis.icu.IcuNormalizerCharFilterFactory;
import org.xbib.elasticsearch.index.analysis.icu.IcuNormalizerTokenFilterFactory;
import org.xbib.elasticsearch.index.analysis.icu.IcuNumberFormatTokenFilterFactory;
import org.xbib.elasticsearch.index.analysis.icu.IcuTransformTokenFilterFactory;
import org.xbib.elasticsearch.index.analysis.icu.segmentation.IcuTokenizerFactory;
import org.xbib.elasticsearch.index.analysis.naturalsort.NaturalSortKeyAnalyzerProvider;
import org.xbib.elasticsearch.index.analysis.naturalsort.NaturalSortKeyTokenizerFactory;
import org.xbib.elasticsearch.index.analysis.sortform.SortformAnalyzerProvider;
import org.xbib.elasticsearch.index.analysis.sortform.SortformTokenFilterFactory;
import org.xbib.elasticsearch.index.analysis.standardnumber.StandardnumberAnalyzerProvider;
import org.xbib.elasticsearch.index.analysis.standardnumber.StandardnumberTokenFilterFactory;
import org.xbib.elasticsearch.index.analysis.symbolname.SymbolnameTokenFilterFactory;
import org.xbib.elasticsearch.index.analysis.worddelimiter.WordDelimiterFilter2Factory;
import org.xbib.elasticsearch.index.analysis.worddelimiter.WordDelimiterFilterFactory;
import org.xbib.elasticsearch.index.analysis.year.GregorianYearTokenFilterFactory;
import org.xbib.elasticsearch.index.mapper.crypt.CryptMapper;
import org.xbib.elasticsearch.index.mapper.langdetect.LangdetectMapper;
import org.xbib.elasticsearch.index.mapper.reference.ReferenceMapper;
import org.xbib.elasticsearch.index.mapper.reference.ReferenceMapperModule;
import org.xbib.elasticsearch.index.mapper.reference.ReferenceMapperTypeParser;
import org.xbib.elasticsearch.common.reference.ReferenceService;
import org.xbib.elasticsearch.index.mapper.standardnumber.StandardnumberMapper;
import org.xbib.elasticsearch.index.mapper.standardnumber.StandardnumberMapperModule;
import org.xbib.elasticsearch.index.mapper.standardnumber.StandardnumberMapperTypeParser;
import org.xbib.elasticsearch.common.standardnumber.StandardnumberService;
import org.xbib.elasticsearch.rest.action.isbnformat.RestISBNFormatterAction;
import org.xbib.elasticsearch.rest.action.langdetect.RestLangdetectAction;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.function.Supplier;

/**
 *
 */
public class BundlePlugin extends Plugin implements AnalysisPlugin, MapperPlugin, ActionPlugin {

    private static final StandardnumberMapperTypeParser standardNumberTypeParser =
            new StandardnumberMapperTypeParser();

    private static final ReferenceMapperTypeParser referenceMapperTypeParser =
            new ReferenceMapperTypeParser();

    private final Settings settings;

    public BundlePlugin(Settings settings) {
        this.settings = settings;
    }

    @Override
    public List<Setting<?>> getSettings() {
        return Arrays.asList(new Setting<>("plugins.xbib.icu.enabled", "true", Function.identity(), Setting.Property.NodeScope));
    }

{'fraction_non_alphanumeric': 0.08630748112560055, 'fraction_numerical': 0.00017158544955387783, 'mean_word_length': 7.797735849056604, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '1116617', 'n_tokens_mistral': 3130, 'n_tokens_neox': 3218, 'n_words': 388}