PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3-beta
Jetpack – WP Security, Backup, Speed, & Growth v16.3-beta
16.3-beta 16.3-a.5 16.3-a.7 16.3-a.3 16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 All 507 releases
jetpack / vendor / wikimedia / aho-corasick / README.md

README.md in Jetpack – WP Security, Backup, Speed, & Growth 16.3-beta, at vendor/wikimedia/aho-corasick/README.md

57 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 [](https://packagist.org/packages/wikimedia/aho-corasick![Packagist.org](https://img.shields.io/packagist/v/wikimedia/aho-corasick.svg?style=flat)](https://packagist.org/packages/wikimedia/aho-corasick](https://packagist.org/packages/wikimedia/aho-corasick)
2
3 AhoCorasick
4 ===========
5
6 AhoCorasick is a PHP implementation of the [Aho-Corasick][1] string search
7 algorithm, which is an efficient way of searching a body of text for multiple
8 search keywords.
9
10 Here is how you use it:
11
12 <pre lang="php">
13 use AhoCorasick\MultiStringMatcher;
14
15 $keywords = new MultiStringMatcher( array( 'ore', 'hell' ) );
16
17 $keywords->searchIn( 'She sells sea shells by the sea shore.' );
18 // Result: array( array( 15, 'hell' ), array( 34, 'ore' ) )
19
20 $keywords->searchIn( 'Say hello to more text. MultiStringMatcher objects are reusable!' );
21 // Result: array( array( 4, 'hell' ), array( 14, 'ore' ) )
22 </pre>
23
24
25 Features
26 --------
27
28 The algorithm works by constructing a finite-state machine out of the set of
29 search keywords. The time it takes to construct the finite state machine is
30 proportional to the sum of the lengths of the search keywords. Once
31 constructed, the machine can locate all occurences of all search keywords in
32 any body of text in a single pass, making exactly one state transition per
33 input character.
34
35
36 Contribute
37 ----------
38
39 - Issue tracker: <https://phabricator.wikimedia.org/tag/ahocorasick/>
40 - Source code: https://github.com/wikimedia/AhoCorasick
41
42
43 Support
44 -------
45
46 If you are having issues, [please let us know][2].
47
48
49 License
50 -------
51
52 The project is licensed under the Apache license.
53
54
55 [1]: https://en.wikipedia.org/wiki/Aho%E2%80%93Corasick_string_matching_algorithm
56 [2]: https://phabricator.wikimedia.org/maniphest/task/create/?projects=PHID-PROJ-hs5ausnvlfs4e3n5gmzg
57