Skip to content

Prefilter matches #134

Answered by BurntSushi
jongiddy asked this question in Q&A
Nov 9, 2023 · 1 comments · 4 replies
Discussion options

You must be logged in to vote
  1. If aho_corasick is a pattern, a haystack of some aho_c returns a PossibleStartOfMatch starting at the a. Can this behaviour be relied on, or is it an accident of the implementation? The current behavior is useful for streams but, following the documentation, the implementation could return NoMatch for this case.

It definitely cannot be relied upon. The only thing you can rely upon is that a prefilter never has any false negatives. It can have false positives, but which false positives it has is implementation defined.

2. When a Match(m) is returned by the prefilter, where is the best position to restart the scan? m.start() + 1 or m.end()?

It probably depends on what you're doing. Ei…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@jongiddy
Comment options

@BurntSushi
Comment options

@jongiddy
Comment options

@BurntSushi
Comment options

Answer selected by jongiddy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants