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

com.mayabot.nlp.segment.plugins.customwords.CustomDictionaryPlugin Maven / Gradle / Ivy

There is a newer version: 4.0.0
Show newest version
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));
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy