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

Appears to sometimes handle stemming badly when long matches precede short ones in keyword list. #3

Closed
HappMacDonald opened this issue Nov 8, 2018 · 1 comment

Comments

@HappMacDonald
Copy link

Test case:
ac = new AhoCorasick(['.com.au','.com']);
ac.search("www.yahoo.com")
console> [ ]

If you change the order then it works fine:
ac = new AhoCorasick(['.com','.com.au'])
ac.search("www.yahoo.com")
console> ... 12, ... ".com" ...

Diagnostically, I see that the "output" part of the AhoCorasick object wrongly lists ".com" at the same final node as ".com.au" when the shorter term is put after the longer one:

console> ...output:
1: []
2: []
3: []
4: []
5: []
6: []
7: (2) [".com.au", ".com"]

@HappMacDonald HappMacDonald changed the title Appears to sometimes handle stemming badly when long matches precede short ones. Appears to sometimes handle stemming badly when long matches precede short ones in keyword list. Nov 8, 2018
BrunoRB added a commit that referenced this issue Nov 8, 2018
@BrunoRB
Copy link
Owner

BrunoRB commented Nov 8, 2018

Yeah, looks like there's a bug ;( I will have a look into it soon.
Thanks for the report!

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

2 participants