Example usage for org.apache.lucene.analysis.gl GalicianAnalyzer GalicianAnalyzer

List of usage examples for org.apache.lucene.analysis.gl GalicianAnalyzer GalicianAnalyzer

Introduction

In this page you can find the example usage for org.apache.lucene.analysis.gl GalicianAnalyzer GalicianAnalyzer.

Prototype

public GalicianAnalyzer(CharArraySet stopwords, CharArraySet stemExclusionSet) 

Source Link

Document

Builds an analyzer with the given stop words.

Usage

From source file:org.elasticsearch.analysis.common.GalicianAnalyzerProvider.java

License:Apache License

GalicianAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
    super(indexSettings, name, settings);
    analyzer = new GalicianAnalyzer(
            Analysis.parseStopWords(env, settings, GalicianAnalyzer.getDefaultStopSet()),
            Analysis.parseStemExclusion(settings, CharArraySet.EMPTY_SET));
    analyzer.setVersion(version);//w  ww.  j  ava 2s.  com
}

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

License:Open Source License

@Override
protected TokenStream getTokenStream(final String strOrig, final boolean stemsAllowed,
        final boolean stopWordsAllowed) {
    if (stemsAllowed) {
        Set<?> stopWords = stopWordsAllowed ? GalicianAnalyzer.getDefaultStopSet() : Collections.EMPTY_SET;
        return new GalicianAnalyzer(getBehavior(), stopWords).tokenStream("", new StringReader(strOrig));
    } else {/*  ww  w .  ja v a  2s .co m*/
        return new StandardTokenizer(getBehavior(), new StringReader(strOrig));
    }
}