2017 © Pedro Peláez
 

library aho-corasick

An implementation of the Aho-Corasick string matching algorithm.

image

wikimedia/aho-corasick

An implementation of the Aho-Corasick string matching algorithm.

  • Saturday, July 28, 2018
  • by mediawiki
  • Repository
  • 18 Watchers
  • 17 Stars
  • 1,112 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 3 Versions
  • 8 % Grown

The README.md

Packagist.org, (*1)

AhoCorasick

AhoCorasick is a PHP implementation of the [Aho-Corasick][1] string search algorithm, which is an efficient way of searching a body of text for multiple search keywords., (*2)

Here is how you use it:, (*3)

use AhoCorasick\MultiStringMatcher;

$keywords = new MultiStringMatcher( array( 'ore', 'hell' ) );

$keywords->searchIn( 'She sells sea shells by the sea shore.' );
// Result: array( array( 15, 'hell' ), array( 34, 'ore' ) )

$keywords->searchIn( 'Say hello to more text. MultiStringMatcher objects are reusable!' );
// Result: array( array( 4, 'hell' ), array( 14, 'ore' ) )

Features

The algorithm works by constructing a finite-state machine out of the set of search keywords. The time it takes to construct the finite state machine is proportional to the sum of the lengths of the search keywords. Once constructed, the machine can locate all occurences of all search keywords in any body of text in a single pass, making exactly one state transition per input character., (*4)

The algorithm originates from "Efficient string matching: an aid to bibliographic search" (CACM, Volume 18, Issue 6, June 1975) by Alfred V. Aho and Margaret J. Corasick., (*5)

See also the definition and reference implementation on nist.gov., (*6)

Contribute

  • Issue tracker: https://phabricator.wikimedia.org/tag/ahocorasick/
  • Source code: https://gerrit.wikimedia.org/g/AhoCorasick

Support

If you are having issues, [please let us know][2]., (*7)

License

The project is licensed under the Apache license., (*8)

The Versions

28/07 2018

dev-master

9999999-dev https://gerrit.wikimedia.org/g/AhoCorasick

An implementation of the Aho-Corasick string matching algorithm.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.5.9

 

The Development Requires

by Ori Livneh

ahocorasick matcher

01/05 2018

v1.0.1

1.0.1.0 https://gerrit.wikimedia.org/g/AhoCorasick

An implementation of the Aho-Corasick string matching algorithm.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.5.9

 

The Development Requires

by Ori Livneh

ahocorasick matcher

24/11 2015

v1.0.0

1.0.0.0 https://www.mediawiki.org/wiki/AhoCorasick

An implementation of the Aho-Corasick string matching algorithm.

  Sources   Download

Apache-2.0

The Requires

  • php >=5.3.3

 

The Development Requires

by Ori Livneh