{"id":43223284,"url":"https://github.com/gnames/aho_corasick","last_synced_at":"2026-02-01T09:15:55.378Z","repository":{"id":57630799,"uuid":"408632069","full_name":"gnames/aho_corasick","owner":"gnames","description":"Implementation of Aho-Corasick algorithm","archived":false,"fork":false,"pushed_at":"2024-11-11T17:57:26.000Z","size":2600,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-11T18:38:18.834Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gnames.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-20T23:39:32.000Z","updated_at":"2024-11-11T17:54:16.000Z","dependencies_parsed_at":"2024-11-11T18:30:15.854Z","dependency_job_id":"54b2dec5-83f2-4bef-8400-b5557ba97856","html_url":"https://github.com/gnames/aho_corasick","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/gnames/aho_corasick","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnames%2Faho_corasick","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnames%2Faho_corasick/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnames%2Faho_corasick/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnames%2Faho_corasick/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gnames","download_url":"https://codeload.github.com/gnames/aho_corasick/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnames%2Faho_corasick/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28974537,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T08:16:14.655Z","status":"ssl_error","status_checked_at":"2026-02-01T08:06:51.373Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-02-01T09:15:53.927Z","updated_at":"2026-02-01T09:15:55.364Z","avatar_url":"https://github.com/gnames.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aho_corasick\n\nA Go implementation of Aho-Corasick algorithm for efficient multiple pattern\nmatching within a string.\n\n## Introduction\n\nThis project implements the powerful string searching [Aho-Corasick\nalgorithm](https://dl.acm.org/doi/10.1145/360825.360855) invented by Alfred V.\nAho and Margaret J. Corasick in the Go programming language. The Aho-Corasick\nalgorithm is useful because it efficiently indexes all occurrences of a list of\nkeywords within a text string.\n\nThis implementation searches at the letter level instead of the word level.\nBoth [failure links](https://www.youtube.com/watch?v=O7_w001f58c) and\n[dictionary links](https://www.youtube.com/watch?v=OFKxWFew_L0) are\nimplemented.\n\n## Installation\n\nThe Go module is installable by running:\n\n```bash\ngo get github.com/gnames/aho_corasick\n```\n\n## Usage\n\nereate a new aho_corasick instance with `aho_corasick.New()` and setup the\nautomaton with the search patterns with `ac.Setup(patterns)`. Run search with\n`ac.Setup(patterns)`, which returns an array of matches.\n\n```go\nac := aho_corasick.New()\npatterns := []string{\"aba\", \"cla\", \"ac\", \"gee\", \"lan\"}\nac.Setup(patterns)\nhaystack := \"abacgeeaba\"\nmatches := ac.Search(haystack)\n\n```\n\n## Development\n\nIf you find a bug, please open an\n[issue](https://github.com/gnames/aho_corasick/issues) ticket. Pull requests\nare welcome.\n\nTests can be run with `go test` which will produce a text visual of the trie:\n\n```text\n******* Trie *******\n\nhaystack: abacgeeaba\n\nroot-\u003eroot ┬─ a-\u003eroot ┬─ b-\u003eroot ── a*-\u003ea\n           │          └─ c*-\u003ec\n           ├─ c-\u003eroot ── l-\u003el ── a*-\u003ea\n           ├─ g-\u003eroot ── e-\u003eroot ── e*-\u003eroot\n           └─ l-\u003eroot ── a-\u003ea ── n*-\u003eroot\n\n********************\nPASS\n```\n\nIn the trie output, `root` refers to the root node, `*` represents word nodes,\n`-\u003e` indicates the failure links, `|` indicates dictionary links.\n\n\nTrie output can also be produced with the debugger, which can be run with:\n\n```go\nac := aho_corasick.New()\nhaystack := \"geeabaclaba\"\npatterns := []string{\"aba\", \"cla\", \"ac\", \"gee\", \"lan\"}\nac.Setup(patterns)\nac.Debug(haystack)\n```\n\n## License\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n## Authors\n\n\n* [Dmitry Mozzherin]\n* [Geoff Ower]\n\n[Dmitry Mozzherin]: https://github.com/dimus\n[Geoff Ower]: https://github.com/gdower\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgnames%2Faho_corasick","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgnames%2Faho_corasick","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgnames%2Faho_corasick/lists"}