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
Add Contains() function #5
Conversation
Hi @allenluce the only change i would make is to make the comment more "go doc/golint" friendly.
i.e.. // Contains returns true if any string matches. It can be faster if you
// do not need to know which words matched.
func (m *Matcher) Contains(in []byte) bool { I'll see if I can track down the repo owner. |
Hi again @allenluce , he's on twitter with the same name @jgrahamc if you want to ping him. Github notifications aren't so great and easy for things to get lost. |
FWIW: since I'm paranoid, I added a |
Yup. I'd done the same thing myself. |
That last change might have been too aggressive @allenluce on my box this fails:
|
Going back to your first implimentation https://github.com/allenluce/ahocorasick/blob/bae7daa5dcf283972e143516e7da54d1d04242d9/ahocorasick.go works |
This function shortcuts the normal process of finding strings, exiting early on the first string match. This can give a practical speed-up in cases where only existence of any string matters. The go1.8 gofmt flattens the import statement.
OK. I pulled that back and squashed commits. |
Is this something that might be merged in? |
Hi, I find this feature very useful, I wonder what is the latest status of this PR? |
hi @nanmu42 see https://github.com/signalsciences/ac the Match and MatchString does the "contains" |
Is there a replacement or substitute for this? |
If someone could fix the pull request to merge I'd look at it. |
This function shortcuts the normal process of finding strings, exiting early on the first string match. This can give a practical speed-up in cases where only existence of any string matters.