Skip to content

Document order of returned matches #137

@mcpower

Description

@mcpower

The order of the returned matches from AhoCorasick methods is not explicitly documented. While the order can be inferred from the examples given, it is not fully clear for overlapping matches.

The overlapping example shows that the .end() of matches is strictly non-decreasing, but it does not show the behaviour when two matches end at the same index. I assume there are a few possibilities for what happens in this case:

  • longest match (earliest start) first
  • shortest match (latest start) first
  • earliest PatternID first
  • unspecified / random order

It would be helpful to document what happens in this case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions