<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.8.15</version>
</dependency>
public static void main(String[] args) {
WordTree wordTree = new WordTree();
wordTree.addWord("买");
wordTree.addWord("高低");
wordTree.addWord("低买");
wordTree.addWord("高卖");
String text="低买高卖高频交易";
System.out.println(wordTree.isMatch(text));
System.out.println(wordTree.match(text));
System.out.println(wordTree.matchAll(text));
System.out.println(wordTree.matchAll(text,-1,false,false));
System.out.println(wordTree.matchAll(text,-1,true,false));
System.out.println(wordTree.matchAll(text,-1,false,true));
System.out.println(wordTree.matchAll(text,-1,true,true));
}