src/java/org/elasticsearch/analysis/hunspell/pt_BR/BrazilianHunspellAnalyzer.java [66:103]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    super(stopwords);
    this.dictionary = dictionary;
    this.stemExclusionTable = stemExclusionTable;
  }
  
  private static class DefaultSetHolder {
    private static final CharArraySet DEFAULT_SET;
  
    static {
      try {
        DEFAULT_SET = WordlistLoader.getSnowballWordSet(
                        IOUtils.getDecodingReader(SnowballFilter.class, PortugueseAnalyzer.DEFAULT_STOPWORD_FILE, StandardCharsets.UTF_8), 
                        new CharArraySet(16, true));
      } catch (IOException ex) {
        // default set should always be present as it is part of the
        // distribution (JAR)
        throw new RuntimeException("Unable to load default stopword set");
      }
    }
  }
  
  /**
   * Returns a set of default (case-insensitive) stopwords
   */
  public static final CharArraySet getDefaultStopSet() {
    return DefaultSetHolder.DEFAULT_SET;
  }

  @Override
  protected TokenStreamComponents createComponents(String field) {
    final Tokenizer source = new StandardTokenizer();
    TokenStream result = new StopFilter(source, stopwords);
    if (!this.stemExclusionTable.isEmpty()) {
      result = new SetKeywordMarkerFilter(result, stemExclusionTable);
    }
    result = new HunspellStemFilter(result, dictionary);
    result = new LowerCaseFilter(result);
    return new TokenStreamComponents(source, result);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



src/java/org/elasticsearch/analysis/hunspell/pt_PT/PortugueseHunspellAnalyzer.java [66:103]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    super(stopwords);
    this.dictionary = dictionary;
    this.stemExclusionTable = stemExclusionTable;
  }
  
  private static class DefaultSetHolder {
    private static final CharArraySet DEFAULT_SET;
  
    static {
      try {
        DEFAULT_SET = WordlistLoader.getSnowballWordSet(
                        IOUtils.getDecodingReader(SnowballFilter.class, PortugueseAnalyzer.DEFAULT_STOPWORD_FILE, StandardCharsets.UTF_8), 
                        new CharArraySet(16, true));
      } catch (IOException ex) {
        // default set should always be present as it is part of the
        // distribution (JAR)
        throw new RuntimeException("Unable to load default stopword set");
      }
    }
  }
  
  /**
   * Returns a set of default (case-insensitive) stopwords
   */
  public static final CharArraySet getDefaultStopSet() {
    return DefaultSetHolder.DEFAULT_SET;
  }

  @Override
  protected TokenStreamComponents createComponents(String field) {
    final Tokenizer source = new StandardTokenizer();
    TokenStream result = new StopFilter(source, stopwords);
    if (!this.stemExclusionTable.isEmpty()) {
      result = new SetKeywordMarkerFilter(result, stemExclusionTable);
    }
    result = new HunspellStemFilter(result, dictionary);
    result = new LowerCaseFilter(result);
    return new TokenStreamComponents(source, result);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



