com.mayabot.nlp.lucene.MynlpAnalyzer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mynlp-lucene Show documentation
Show all versions of mynlp-lucene Show documentation
Maya Nlp subproject :modules:mynlp-lucene
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);
}
}