com.helipy.text.ahocorasick.Automaton Maven / Gradle / Ivy
package com.helipy.text.ahocorasick;
import java.util.List;
/**
* @param The related object type
* @author nuclear-sun
*/
public interface Automaton {
/**
* Parse matched keywords in text with callback handler
*
* @param text text to scan
* @param handler how to handle matched keyword
*/
void parseText(CharSequence text, MatchHandler handler);
/**
* Parse matched keywords in text
*
* @param text text to scan
* @return matched keyword list, with word, start and end location in text, and related object if having config
*/
List> parseText(CharSequence text);
}