FileDocCategorySizeDatePackage
RussianLowerCaseFilter.javaAPI DocApache Lucene 1.4.31837Tue Mar 30 00:48:02 BST 2004org.apache.lucene.analysis.ru

RussianLowerCaseFilter

public final class RussianLowerCaseFilter extends TokenFilter
Normalizes token text to lower case, analyzing given ("russian") charset.
author
Boris Okner, b.okner@rogers.com
version
$Id: RussianLowerCaseFilter.java,v 1.4 2004/03/29 22:48:01 cutting Exp $

Fields Summary
char[]
charset
Constructors Summary
public RussianLowerCaseFilter(TokenStream in, char[] charset)

        super(in);
        this.charset = charset;
    
Methods Summary
public final org.apache.lucene.analysis.Tokennext()

        Token t = input.next();

        if (t == null)
            return null;

        String txt = t.termText();

        char[] chArray = txt.toCharArray();
        for (int i = 0; i < chArray.length; i++)
        {
            chArray[i] = RussianCharsets.toLowerCase(chArray[i], charset);
        }

        String newTxt = new String(chArray);
        // create new token
        Token newToken = new Token(newTxt, t.startOffset(), t.endOffset());

        return newToken;