Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

您好,请问如何支持正则表达式的多模式匹配? #18

Open
UCASREN opened this issue Sep 6, 2018 · 0 comments
Open

您好,请问如何支持正则表达式的多模式匹配? #18

UCASREN opened this issue Sep 6, 2018 · 0 comments

Comments

@UCASREN
Copy link

UCASREN commented Sep 6, 2018

如下。

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",当前是无法提取的。如果想做到如此,该如何修改源码?从哪入手比较好,请指教,多谢~~~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant