fr.gouv.culture.sdx.search.lucene.analysis.filter
Class ISOLatin1AccentFilter

java.lang.Object
  extended byorg.apache.lucene.analysis.TokenStream
      extended byorg.apache.lucene.analysis.TokenFilter
          extended byfr.gouv.culture.sdx.search.lucene.analysis.filter.ISOLatin1AccentFilter
All Implemented Interfaces:
org.apache.avalon.framework.logger.LogEnabled

public class ISOLatin1AccentFilter
extends org.apache.lucene.analysis.TokenFilter
implements org.apache.avalon.framework.logger.LogEnabled

A filter that transforms accented characters in the ISO Latin 1 character set to their unaccented counterparts.

For example, the letter 'é' will be converted to 'e'.

This filter does'nt change the character case. If one wants to lowercase letters, it should also use another filter.


Field Summary
 
Fields inherited from class org.apache.lucene.analysis.TokenFilter
input
 
Constructor Summary
ISOLatin1AccentFilter()
          Builds a new filter
 
Method Summary
 void enableLogging(org.apache.avalon.framework.logger.Logger logger)
          Set's the super.getLog()
 org.apache.lucene.analysis.Token next()
          Transform ISOLatin1 accented characters to their unaccented counterparts.
static java.lang.String removeAccents(java.lang.String s)
          Removes accented characters from a string
 void setUp(org.apache.lucene.analysis.TokenStream in)
          Builds a filter from a token stream.
 
Methods inherited from class org.apache.lucene.analysis.TokenFilter
close
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ISOLatin1AccentFilter

public ISOLatin1AccentFilter()
Builds a new filter

Method Detail

setUp

public void setUp(org.apache.lucene.analysis.TokenStream in)
Builds a filter from a token stream.

Parameters:
in - The input token stream.

next

public final org.apache.lucene.analysis.Token next()
                                            throws java.io.IOException
Transform ISOLatin1 accented characters to their unaccented counterparts.

Throws:
java.io.IOException

enableLogging

public void enableLogging(org.apache.avalon.framework.logger.Logger logger)
Set's the super.getLog()

Specified by:
enableLogging in interface org.apache.avalon.framework.logger.LogEnabled
Parameters:
logger - The super.getLog() to use.

removeAccents

public static java.lang.String removeAccents(java.lang.String s)
Removes accented characters from a string

Parameters:
s - The string to analyze
Returns:
The same string without accents (� => e, etc.)


Copyright © 2000-2003 Ministere de la culture et de la communication / AJLSM. All Rights Reserved.