cloudflare / cloudflare/ahocorasick

Doesn't return index of keywords found in text

Open
#13 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
Go
Stars
727
Forks
108
PR merge metrics
No merged PRs in 30d

Description

I've noticed that the implementation doesn't return the index of where keywords were found in text. This forces the user to do another search for the keyword to find its index, while the Aho Corasick algorithm should be able to provide this information for no extra cost.

I've made several modifications to the implementation in my fork https://github.com/issamemari/ahocorasick, among which is making the algorithm return the index the index. I'm happy to submit a PR that includes only the changes related to this.

Contributor guide

Open the contributing guide

Research direction

Read the repository's current Aho-Corasick matching implementation and compare the fork linked in the issue, focusing on how keyword matches are returned. Done means callers receive the index of each keyword found in the text without performing a second search, while unrelated fork changes are excluded.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
search
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.