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

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

Introduction

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

Prototype

String PATTERN

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

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 {/*  www .j  a v  a 2 s  .  c  o m*/
        lowerCaseFilterFactory = null;
    }
}