Package com.flaptor.hounder

Source Code of com.flaptor.hounder.LatinStandardAnalyzer

package com.flaptor.hounder;

import java.io.IOException;
import java.io.Reader;

import org.apache.lucene.analysis.ISOLatin1AccentFilter;
import org.apache.lucene.analysis.TokenStream;
import org.apache.lucene.analysis.StopFilter;
import org.apache.lucene.analysis.standard.StandardAnalyzer;

public class LatinStandardAnalyzer extends StandardAnalyzer {

    public LatinStandardAnalyzer(String[] stopWords) {
        super(stopWords);
    }

    /** Constructs a {@link StandardTokenizer} filtered by a {@link
      StandardFilter}, a {@link LowerCaseFilter} and a {@link StopFilter}. */
    @Override
    public TokenStream tokenStream(String fieldName, Reader reader) {
        TokenStream result = super.tokenStream(fieldName, reader);
        result = new ISOLatin1AccentFilter(result);
        return result;
    }

    @Override
    public TokenStream reusableTokenStream(String fieldName, Reader reader) throws IOException {
        TokenStream result = super.reusableTokenStream(fieldName, reader);
        result = new ISOLatin1AccentFilter(result);
        return result;
    }
   
}
TOP

Related Classes of com.flaptor.hounder.LatinStandardAnalyzer

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.