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

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

Introduction

In this page you can find the example usage for org.apache.lucene.analysis.lv LatvianAnalyzer LatvianAnalyzer.

Prototype

public LatvianAnalyzer(CharArraySet stopwords, CharArraySet stemExclusionSet) 

Source Link

Document

Builds an analyzer with the given stop words.

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 ww  w .  j av  a2 s .c  om*/
}

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 {//from   w  w  w  .  ja  va  2s .  c o m
        return new StandardTokenizer(getBehavior(), new StringReader(strOrig));
    }
}