com.mayabot.nlp.segment.lexer.perceptron.PerceptronSegmentPlugin Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mynlp Show documentation
Show all versions of mynlp Show documentation
Maya Nlp subproject :mynlp
package com.mayabot.nlp.segment.lexer.perceptron;
import com.mayabot.nlp.segment.lexer.core.ViterbiBestPathAlgorithm;
import com.mayabot.nlp.segment.pipeline.PipelineLexerBuilder;
import com.mayabot.nlp.segment.pipeline.PipelineLexerPlugin;
import com.mayabot.nlp.segment.plugins.atom.AtomSplitAlgorithm;
public class PerceptronSegmentPlugin implements PipelineLexerPlugin {
@Override
public void install(PipelineLexerBuilder builder) {
//切词算法
builder.addWordSplitAlgorithm(PerceptronSegmentAlgorithm.class);
builder.addWordSplitAlgorithm(AtomSplitAlgorithm.class);
//最优路径算法
builder.setBestPathComputer(ViterbiBestPathAlgorithm.class);
}
}