Example usage for org.apache.lucene.analysis.pl PolishAnalyzer PolishAnalyzer

List of usage examples for org.apache.lucene.analysis.pl PolishAnalyzer PolishAnalyzer

Introduction

In this page you can find the example usage for org.apache.lucene.analysis.pl PolishAnalyzer PolishAnalyzer.

Prototype

public PolishAnalyzer(CharArraySet stopwords) 

Source Link

Document

Builds an analyzer with the given stop words.

Usage

From source file:org.elasticsearch.index.analysis.pl.PolishAnalyzerProvider.java

License:Apache License

@Inject
public PolishAnalyzerProvider(Index index, IndexSettingsService indexSettingsService, Environment env,
        @Assisted String name, @Assisted Settings settings) {
    super(index, indexSettingsService.getSettings(), name, settings);

    analyzer = new PolishAnalyzer(PolishAnalyzer.getDefaultStopSet());
    analyzer.setVersion(version);/* ww  w  . ja  va  2 s . co  m*/
}

From source file:org.omegat.tokenizer.LucenePolishTokenizer.java

License:Open Source License

@SuppressWarnings("resource")
@Override//  w  w  w. jav  a  2s .c  om
protected TokenStream getTokenStream(final String strOrig, final boolean stemsAllowed,
        final boolean stopWordsAllowed) throws IOException {
    if (stemsAllowed) {
        CharArraySet stopWords = stopWordsAllowed ? PolishAnalyzer.getDefaultStopSet() : CharArraySet.EMPTY_SET;
        PolishAnalyzer analyzer = new PolishAnalyzer(stopWords);
        return analyzer.tokenStream("", new StringReader(strOrig));
    } else {
        return getStandardTokenStream(strOrig);
    }
}