Example usage for org.apache.lucene.analysis.eu BasqueAnalyzer BasqueAnalyzer

List of usage examples for org.apache.lucene.analysis.eu BasqueAnalyzer BasqueAnalyzer

Introduction

In this page you can find the example usage for org.apache.lucene.analysis.eu BasqueAnalyzer BasqueAnalyzer.

Prototype

public BasqueAnalyzer(CharArraySet stopwords, CharArraySet stemExclusionSet) 

Source Link

Document

Builds an analyzer with the given stop words.

Usage

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

License:Apache License

BasqueAnalyzerProvider(IndexSettings indexSettings, Environment env, String name, Settings settings) {
    super(indexSettings, name, settings);
    analyzer = new BasqueAnalyzer(Analysis.parseStopWords(env, settings, BasqueAnalyzer.getDefaultStopSet()),
            Analysis.parseStemExclusion(settings, CharArraySet.EMPTY_SET));
    analyzer.setVersion(version);//from  ww  w  . ja  v a  2  s.c  o m
}

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

License:Open Source License

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