@@ -0,0 +1,2121 @@
+package org.exist.indexing.lucene;%0A%0A/**%0A * Copyright 2004 The Apache Software Foundation%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *     http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0A/** Based on ISOLatin1AccentAnalyzer by Mike Sokolov, generous thanks go%0A *  to him. Edited by Tom Wrobel (thomas.wrobel@classics.ox.ac.uk)%0A**/%0A%0Aimport org.apache.lucene.analysis.*;%0Aimport org.apache.lucene.analysis.standard.*;%0Aimport java.io.Reader;%0Aimport java.util.Set;%0A%0A/**%0A * Filters %7B@link StandardTokenizer%7D with %7B@link StandardFilter%7D, %7B@link%0A * LowerCaseFilter%7D, %7B@link DiacriticFilter%7D and %7B@link StopFilter%7D.%0A*/%0Apublic class DMLBSAccentAnalyzer extends Analyzer %7B%0A  private Set%3CString%3E stopSet;%0A%0A  /** An array containing some common English words that are usually not%0A  useful for searching. */%0A  public static final String%5B%5D STOP_WORDS = StopAnalyzer.ENGLISH_STOP_WORDS;%0A%0A  /** Builds an analyzer. */%0A  public DMLBSAccentAnalyzer() %7B%0A    this(STOP_WORDS);%0A  %7D%0A%0A  /** Builds an analyzer with the given stop words. */%0A  public DMLBSAccentAnalyzer(String%5B%5D stopWords) %7B%0A    stopSet = StopFilter.makeStopSet(stopWords);%0A  %7D%0A%0A  /** Constructs a %7B@link StandardTokenizer%7D filtered by a %7B@link%0A  StandardFilter%7D, a %7B@link LowerCaseFilter%7D and a %7B@link StopFilter%7D. */%0A  public TokenStream tokenStream(String fieldName, Reader reader) %7B%0A    TokenStream result = new StandardTokenizer(reader);%0A    result = new StandardFilter(result);%0A    result = new LowerCaseFilter(result);%0A    result = new org.exist.indexing.lucene.DMLBSAccentFilter(result);%0A    //result = new ASCIIFoldingFilter(result);%0A    result = new StopFilter(result, stopSet);%0A    return result;%0A  %7D%0A%7D%0A

Create DMLBSAccentAnalyzer.java