com.mayabot.nlp.segment.plugins.customwords.CustomDictionaryPlugin 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.plugins.customwords;
import com.mayabot.nlp.Mynlps;
import com.mayabot.nlp.segment.pipeline.PipelineLexerBuilder;
import com.mayabot.nlp.segment.pipeline.PipelineLexerPlugin;
public class CustomDictionaryPlugin implements PipelineLexerPlugin {
private CustomDictionary customDictionary;
public CustomDictionaryPlugin(CustomDictionary customDictionary) {
this.customDictionary = customDictionary;
}
public CustomDictionaryPlugin() {
customDictionary = Mynlps.instanceOf(CustomDictionary.class);
}
@Override
public void install(PipelineLexerBuilder builder) {
builder.addProcessor(new CustomDictionaryProcessor(customDictionary));
}
}