Example usage for org.apache.lucene.analysis.hi HindiAnalyzer HindiAnalyzer

List of usage examples for org.apache.lucene.analysis.hi HindiAnalyzer HindiAnalyzer

Introduction

In this page you can find the example usage for org.apache.lucene.analysis.hi HindiAnalyzer HindiAnalyzer.

Prototype

public HindiAnalyzer(CharArraySet stopwords, CharArraySet stemExclusionSet) 

Source Link

Document

Builds an analyzer with the given stop words

Usage

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

License:Apache License

HindiAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
    super(indexSettings, name, settings);
    analyzer = new HindiAnalyzer(Analysis.parseStopWords(env, settings, HindiAnalyzer.getDefaultStopSet()),
            Analysis.parseStemExclusion(settings, CharArraySet.EMPTY_SET));
    analyzer.setVersion(version);//from  w ww.  ja  va 2 s  .  com
}

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

License:Open Source License

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