您好,请问如何支持正则表达式的多模式匹配?
UCASREN opened this issue · 0 comments
UCASREN commented
如下。
TreeMap<String, String> map = new TreeMap<String, String>();
String[] keyArray = new String[] {"he*r"};
for (String key : keyArray) {
map.put(key, key);
}
// Build an AhoCorasickDoubleArrayTrie
AhoCorasickDoubleArrayTrie<String> acdat = new AhoCorasickDoubleArrayTrie<String>();
acdat.build(map);
// Test it
final String text = "uheers";
List<AhoCorasickDoubleArrayTrie.Hit<String>> wordList = acdat.parseText(text);
for (Hit<String> tmp : wordList) {
System.out.println(tmp.begin);
System.out.println(tmp.end);
System.out.println(tmp.value);
System.out.println();
}
我想提取出"heer",当前是无法提取的。如果想做到如此,该如何修改源码?从哪入手比较好,请指教,多谢~~~