// Path: chapter_17/analysis_plugin/src/main/java/org/elasticsearch/index/analysis/CustomEnglishAnalyzerProvider.java
// public class CustomEnglishAnalyzerProvider extends AbstractIndexAnalyzerProvider<EnglishAnalyzer> {
//     public static String NAME = "custom_english";
// 
//     private final EnglishAnalyzer analyzer;
// 
//     public CustomEnglishAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings, boolean useSmart) {
//         super(indexSettings, name, settings);
// 
//         analyzer = new EnglishAnalyzer(
//                 Analysis.parseStopWords(env, settings, EnglishAnalyzer.getDefaultStopSet(), true),
//                 Analysis.parseStemExclusion(settings, CharArraySet.EMPTY_SET));
//     }
// 
//     public static CustomEnglishAnalyzerProvider getCustomEnglishAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
//         return new CustomEnglishAnalyzerProvider(indexSettings, env, name, settings, true);
//     }
// 
//     @Override
//     public EnglishAnalyzer get() {
//         return this.analyzer;
//     }
// }


import org.apache.lucene.analysis.Analyzer;
import org.elasticsearch.index.analysis.AnalyzerProvider;
import org.elasticsearch.index.analysis.CustomEnglishAnalyzerProvider;
import org.elasticsearch.indices.analysis.AnalysisModule;
import org.elasticsearch.plugins.Plugin;
import java.util.HashMap;
import java.util.Map;
package org.elasticsearch.plugin.analysis;



public class AnalysisPlugin extends Plugin implements org.elasticsearch.plugins.AnalysisPlugin {
    @Override
    public Map<String, AnalysisModule.AnalysisProvider<AnalyzerProvider<? extends Analyzer>>> getAnalyzers() {
        Map<String, AnalysisModule.AnalysisProvider<AnalyzerProvider<? extends Analyzer>>> analyzers = new HashMap();
// Path: chapter_17/analysis_plugin/src/main/java/org/elasticsearch/index/analysis/CustomEnglishAnalyzerProvider.java
// public class CustomEnglishAnalyzerProvider extends AbstractIndexAnalyzerProvider<EnglishAnalyzer> {
//     public static String NAME = "custom_english";
// 
//     private final EnglishAnalyzer analyzer;
// 
//     public CustomEnglishAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings, boolean useSmart) {
//         super(indexSettings, name, settings);
// 
//         analyzer = new EnglishAnalyzer(
//                 Analysis.parseStopWords(env, settings, EnglishAnalyzer.getDefaultStopSet(), true),
//                 Analysis.parseStemExclusion(settings, CharArraySet.EMPTY_SET));
//     }
// 
//     public static CustomEnglishAnalyzerProvider getCustomEnglishAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
//         return new CustomEnglishAnalyzerProvider(indexSettings, env, name, settings, true);
//     }
// 
//     @Override
//     public EnglishAnalyzer get() {
//         return this.analyzer;
//     }
// }


// Path: chapter_17/analysis_plugin/src/main/java/org/elasticsearch/plugin/analysis/AnalysisPlugin.java
import org.apache.lucene.analysis.Analyzer;
import org.elasticsearch.index.analysis.AnalyzerProvider;
import org.elasticsearch.index.analysis.CustomEnglishAnalyzerProvider;
import org.elasticsearch.indices.analysis.AnalysisModule;
import org.elasticsearch.plugins.Plugin;
import java.util.HashMap;
import java.util.Map;

package org.elasticsearch.plugin.analysis;



public class AnalysisPlugin extends Plugin implements org.elasticsearch.plugins.AnalysisPlugin {
    @Override
    public Map<String, AnalysisModule.AnalysisProvider<AnalyzerProvider<? extends Analyzer>>> getAnalyzers() {
        Map<String, AnalysisModule.AnalysisProvider<AnalyzerProvider<? extends Analyzer>>> analyzers = new HashMap();
        analyzers.put(CustomEnglishAnalyzerProvider.NAME, CustomEnglishAnalyzerProvider::getCustomEnglishAnalyzerProvider);