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

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

Introduction

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

Prototype

public static CharArraySet getDefaultStopSet() 

Source Link

Document

Returns an unmodifiable instance of the default stop words set.

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.j  a v a2  s .  com
}

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

License:Open Source License

@SuppressWarnings("resource")
@Override/*from  w w  w .ja  va 2 s. 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);
    }
}