Example usage for org.apache.lucene.analysis.id IndonesianAnalyzer IndonesianAnalyzer

List of usage examples for org.apache.lucene.analysis.id IndonesianAnalyzer IndonesianAnalyzer

Introduction

In this page you can find the example usage for org.apache.lucene.analysis.id IndonesianAnalyzer IndonesianAnalyzer.

Prototype

public IndonesianAnalyzer(CharArraySet stopwords, CharArraySet stemExclusionSet) 

Source Link

Document

Builds an analyzer with the given stop word.

Usage

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

License:Apache License

IndonesianAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
    super(indexSettings, name, settings);
    analyzer = new IndonesianAnalyzer(
            Analysis.parseStopWords(env, settings, IndonesianAnalyzer.getDefaultStopSet()),
            Analysis.parseStemExclusion(settings, CharArraySet.EMPTY_SET));
    analyzer.setVersion(version);/*from   www.j a v a 2  s  .c o  m*/
}

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

License:Open Source License

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