Example usage for org.apache.lucene.analysis.lv LatvianAnalyzer getDefaultStopSet

List of usage examples for org.apache.lucene.analysis.lv LatvianAnalyzer getDefaultStopSet

Introduction

In this page you can find the example usage for org.apache.lucene.analysis.lv LatvianAnalyzer 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.analysis.common.LatvianAnalyzerProvider.java

License:Apache License

LatvianAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
    super(indexSettings, name, settings);
    analyzer = new LatvianAnalyzer(Analysis.parseStopWords(env, settings, LatvianAnalyzer.getDefaultStopSet()),
            Analysis.parseStemExclusion(settings, CharArraySet.EMPTY_SET));
    analyzer.setVersion(version);/*from   w ww.  j a v a2s  . c  om*/
}

From source file:org.elasticsearch.index.analysis.LatvianAnalyzerProvider.java

License:Apache License

@Inject
public LatvianAnalyzerProvider(Index index, @IndexSettings Settings indexSettings, Environment env,
        @Assisted String name, @Assisted Settings settings) {
    super(index, indexSettings, name, settings);
    analyzer = new LatvianAnalyzer(version,
            Analysis.parseStopWords(env, settings, LatvianAnalyzer.getDefaultStopSet(), version),
            Analysis.parseStemExclusion(settings, CharArraySet.EMPTY_SET, version));
}

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

License:Open Source License

@Override
protected TokenStream getTokenStream(final String strOrig, final boolean stemsAllowed,
        final boolean stopWordsAllowed) {
    if (stemsAllowed) {
        Set<?> stopWords = stopWordsAllowed ? LatvianAnalyzer.getDefaultStopSet() : Collections.EMPTY_SET;
        return new LatvianAnalyzer(getBehavior(), stopWords).tokenStream("", new StringReader(strOrig));
    } else {//w  w w .  j  a  v a2s . c om
        return new StandardTokenizer(getBehavior(), new StringReader(strOrig));
    }
}