FileDocCategorySizeDatePackage
ISOLatin1AccentFilter.javaAPI DocApache Lucene 1.94269Mon Feb 20 09:19:46 GMT 2006org.apache.lucene.analysis

ISOLatin1AccentFilter

public class ISOLatin1AccentFilter extends TokenFilter
A filter that replaces accented characters in the ISO Latin 1 character set (ISO-8859-1) by their unaccented equivalent. The case will not be altered.

For instance, 'à' will be replaced by 'a'.

Fields Summary
Constructors Summary
public ISOLatin1AccentFilter(TokenStream input)

		super(input);
	
Methods Summary
public final org.apache.lucene.analysis.Tokennext()

		final Token t = input.next();
		if (t == null)
			return null;
		// Return a token with filtered characters.
		return new Token(removeAccents(t.termText()), t.startOffset(), t.endOffset(), t.type());
	
public static final java.lang.StringremoveAccents(java.lang.String input)
To replace accented characters in a String by unaccented equivalents.

		final StringBuffer output = new StringBuffer();
		for (int i = 0; i < input.length(); i++) {
			switch (input.charAt(i)) {
				case '\u00C0" : // Ã