All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mayabot.nlp.lucene.MynlpAnalyzer Maven / Gradle / Ivy

There is a newer version: 3.1.7
Show newest version
package com.mayabot.nlp.lucene;

import com.mayabot.nlp.segment.LexerReader;
import com.mayabot.nlp.segment.WordTermIterableMode;
import org.apache.lucene.analysis.Analyzer;

/**
 * @author jimichan
 */
public class MynlpAnalyzer extends Analyzer {

    private MynlpTokenizer tokenizer;

    public MynlpAnalyzer(MynlpTokenizer tokenizer) {
        this.tokenizer = tokenizer;
    }

    public MynlpAnalyzer(LexerReader reader) {
        this.tokenizer = new MynlpTokenizer(reader);
    }

    public MynlpAnalyzer(LexerReader reader, WordTermIterableMode mode) {
        this.tokenizer = new MynlpTokenizer(reader, mode);
    }

    @Override
    protected TokenStreamComponents createComponents(final String fieldName) {
        return new TokenStreamComponents(tokenizer);
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy