
import java.io.*;
import java.util.*;

import org.apache.lucene.analysis.*;
import org.apache.lucene.analysis.standard.*;
import org.apache.lucene.util.Version;


/**
 * Simple custom analyzer that combines a bunch of common filters.
 * This would be nice to have in an external config file, but for
 * now we just have this little hard-coded class.
 */
public class CustomAnalyzer extends Analyzer
{
  boolean omitNonAlpha = true;
  Set<?> stopWords;

  public CustomAnalyzer( )
  {

  }

  public CustomAnalyzer( boolean omitNonAlpha, Set<?> stopWords )
  {
    this.omitNonAlpha = omitNonAlpha;
    this.stopWords    = stopWords;
  }
  
  public void setStopWords( Set<?> stopWords )
  {
    this.stopWords = stopWords;
  }

  public Set<?> getStopWords( )
  {
    return this.stopWords;
  }

  public void setOmitNonAlpha( boolean omitNonAlpha )
  {
    this.omitNonAlpha = omitNonAlpha;
  }

  public boolean getOmitNonAlpha( )
  {
    return this.omitNonAlpha;
  }

  public TokenStream tokenStream( String fieldName, Reader reader )
  {
    TokenStream stream = new StandardTokenizer( Version.LUCENE_30, reader );
    stream = new StandardFilter( stream );
    stream = new LowerCaseFilter( stream );
    stream = new ASCIIFoldingFilter( stream );
    if ( this.omitNonAlpha )
      {
        stream = new NonAlphaFilter( stream );
      }
    if ( this.stopWords != null && this.stopWords.size( ) > 0 )
      {
        stream = new StopFilter( true, stream, this.stopWords );
      }

    return stream;
  }

}

@@ -395,16 +395,48 @@
 lyzer%0A%7B%0A
+  boolean foldAccents  = false;%0A
   boolea
@@ -452,19 +452,20 @@
 Alpha = 
-tru
+fals
 e;%0A  Set
@@ -521,158 +521,8 @@
  %7D%0A%0A
-  public CustomAnalyzer( boolean omitNonAlpha, Set%3C?%3E stopWords )%0A  %7B%0A    this.omitNonAlpha = omitNonAlpha;%0A    this.stopWords    = stopWords;%0A  %7D%0A  %0A
   pu
@@ -841,32 +841,202 @@
 tNonAlpha;%0A  %7D%0A%0A
+  public void setFoldAccents( boolean foldAccents )%0A  %7B%0A    this.foldAccents = foldAccents;%0A  %7D%0A%0A  public boolean getFoldAccents( )%0A  %7B%0A    return this.foldAccents;%0A  %7D%0A%0A
   public TokenSt
@@ -1247,32 +1247,72 @@
 lter( stream );%0A
+    if ( this.foldAccents )%0A      %7B%0A    
     stream = new
@@ -1334,32 +1334,40 @@
 lter( stream );%0A
+      %7D%0A
     if ( this.om

Add property to control foldAccents.