Example usage for org.apache.lucene.analysis.pattern PatternTokenizerFactory GROUP

List of usage examples for org.apache.lucene.analysis.pattern PatternTokenizerFactory GROUP

Introduction

In this page you can find the example usage for org.apache.lucene.analysis.pattern PatternTokenizerFactory GROUP.

Prototype

String GROUP

To view the source code for org.apache.lucene.analysis.pattern PatternTokenizerFactory GROUP.

Click Source Link

Usage

From source file:org.aksw.palmetto.corpus.lucene.SimpleAnalyzer.java

License:Open Source License

public SimpleAnalyzer(boolean lowerCase) {
    Map<String, String> parameters = new HashMap<String, String>();
    parameters.put(PatternTokenizerFactory.PATTERN, PATTERN);
    parameters.put(PatternTokenizerFactory.GROUP, "0");
    parameters.put(AbstractAnalysisFactory.LUCENE_MATCH_VERSION_PARAM, version.name());
    tokenizerFactory = new PatternTokenizerFactory(parameters);
    if (lowerCase) {
        parameters = new HashMap<String, String>();
        parameters.put(AbstractAnalysisFactory.LUCENE_MATCH_VERSION_PARAM, version.name());
        lowerCaseFilterFactory = new LowerCaseFilterFactory(parameters);
    } else {//w ww .  j  a  v a 2s  . c  o m
        lowerCaseFilterFactory = null;
    }
}