{"id":15283634,"url":"https://github.com/wikimedia/ahocorasick","last_synced_at":"2025-05-16T05:04:40.293Z","repository":{"id":33387619,"uuid":"37032622","full_name":"wikimedia/AhoCorasick","owner":"wikimedia","description":"A PHP implementation of the Aho-Corasick string search algorithm. Mirror from https://gerrit.wikimedia.org/g/AhoCorasick - our actual code is hosted with Gerrit (please see https://www.mediawiki.org/wiki/Developer_access for contributing)","archived":false,"fork":false,"pushed_at":"2025-05-08T00:03:19.000Z","size":105,"stargazers_count":53,"open_issues_count":0,"forks_count":10,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-05-08T01:19:05.411Z","etag":null,"topics":["aho-corasick","ahocorasick","algorithm"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wikimedia.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2015-06-07T21:17:36.000Z","updated_at":"2025-05-08T00:03:22.000Z","dependencies_parsed_at":"2025-02-16T13:12:35.211Z","dependency_job_id":"10868df8-25da-4ec6-91ab-e79ba052235a","html_url":"https://github.com/wikimedia/AhoCorasick","commit_stats":{"total_commits":73,"total_committers":11,"mean_commits":6.636363636363637,"dds":0.5068493150684932,"last_synced_commit":"16ecb2ce6a4c8c87095dd7cabbd8f1a769e0269d"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wikimedia%2FAhoCorasick","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wikimedia%2FAhoCorasick/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wikimedia%2FAhoCorasick/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wikimedia%2FAhoCorasick/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wikimedia","download_url":"https://codeload.github.com/wikimedia/AhoCorasick/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254471060,"owners_count":22076585,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["aho-corasick","ahocorasick","algorithm"],"created_at":"2024-09-30T14:44:45.811Z","updated_at":"2025-05-16T05:04:40.276Z","avatar_url":"https://github.com/wikimedia.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Packagist.org](https://img.shields.io/packagist/v/wikimedia/aho-corasick.svg?style=flat)](https://packagist.org/packages/wikimedia/aho-corasick)\n\nAhoCorasick\n===========\n\nAhoCorasick is a PHP implementation of the [Aho-Corasick][1] string search\nalgorithm, which is an efficient way of searching a body of text for multiple\nsearch keywords.\n\nHere is how you use it:\n\n```php\nuse AhoCorasick\\MultiStringMatcher;\n\n$keywords = new MultiStringMatcher( array( 'ore', 'hell' ) );\n\n$keywords-\u003esearchIn( 'She sells sea shells by the sea shore.' );\n// Result: array( array( 15, 'hell' ), array( 34, 'ore' ) )\n\n$keywords-\u003esearchIn( 'Say hello to more text. MultiStringMatcher objects are reusable!' );\n// Result: array( array( 4, 'hell' ), array( 14, 'ore' ) )\n```\n\n\nFeatures\n--------\n\nThe algorithm works by constructing a finite-state machine out of the set of\nsearch keywords. The time it takes to construct the finite state machine is\nproportional to the sum of the lengths of the search keywords. Once\nconstructed, the machine can locate all occurences of all search keywords in\nany body of text in a single pass, making exactly one state transition per\ninput character.\n\nThe algorithm originates from [\"Efficient string matching: an aid to bibliographic search\"][paper] (CACM, Volume 18, Issue 6, June 1975) by Alfred V. Aho and Margaret J. Corasick.\n\nSee also the definition and reference implementation on [nist.gov][dads].\n\n\n[paper]: https://doi.org/10.1145/360825.36085\n[dads]: http://xlinux.nist.gov/dads/HTML/ahoCorasick.html\n\nContribute\n----------\n\n- Issue tracker: https://phabricator.wikimedia.org/tag/ahocorasick/\n- Source code: https://gerrit.wikimedia.org/g/AhoCorasick\n\n\nSupport\n-------\n\nIf you are having issues, [please let us know][2].\n\n\nLicense\n-------\n\nThe project is licensed under the Apache license.\n\n\n[1]: https://en.wikipedia.org/wiki/Aho%E2%80%93Corasick_string_matching_algorithm\n[2]: https://phabricator.wikimedia.org/maniphest/task/create/?projects=PHID-PROJ-hs5ausnvlfs4e3n5gmzg\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwikimedia%2Fahocorasick","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwikimedia%2Fahocorasick","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwikimedia%2Fahocorasick/lists"}