Skip to content

Commit

Permalink
Release v2.0.0
Browse files Browse the repository at this point in the history
* Start a high-level changelog.

* Fix NOTICE file to be compliant with what the license text says,
  matching our repos for php-cssjanus, less.php, excimer-ui-client,
  and other Apache-licensed projects.

* Remove outdated build filter for Doxygen and the broken use of
  `<pre lang="">` which doesn't work on Gitiles. The element was
  missing when viewing https://gerrit.wikimedia.org/g/AhoCorasick

* Move repo docs from primary class file to README. In particular
  they were on the @file block, which meant they weren't even prominent
  in the Doxygen output (i.e. not on the class page).

Bug: T301632
Bug: T287972
Change-Id: I8d4f2fc2094e9dde19bd438a57d69eba545dabf9
  • Loading branch information
Krinkle committed Nov 20, 2023
1 parent 16ecb2c commit 15a9bba
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 36 deletions.
1 change: 0 additions & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ INPUT = README.md src/
FILE_PATTERNS = *.php
RECURSIVE = YES
USE_MDFILE_AS_MAINPAGE = README.md
FILTER_PATTERNS = *md=build/doxygen_escape.sh
HTML_DYNAMIC_SECTIONS = YES
GENERATE_TREEVIEW = YES
TREEVIEW_WIDTH = 250
Expand Down
13 changes: 13 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## v2.0.0

* [BREAKING CHANGE] Raise claimed PHP need from 7.0+ to 7.4+ (James D. Forrester)
* [BREAKING CHANGE] Drop HHVM support (James D. Forrester)
* Fix for numeric strings (Miguel Xavier Penha Neto) [T301632](https://phabricator.wikimedia.org/T301632)

## v1.0.1

* docs: Fix `<pre>` compat with Doxygen markdown (Timo Tijhof)

## v1.0.0

* Initial commit (Ori Livneh)
15 changes: 14 additions & 1 deletion NOTICE
Original file line number Diff line number Diff line change
@@ -1,2 +1,15 @@
AhoCorasick PHP Library
wikimedia/aho-corasick. https://gerrit.wikimedia.org/g/AhoCorasick

Copyright 2015 Ori Livneh <[email protected]>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ search keywords.

Here is how you use it:

<pre lang="php">
```php
use AhoCorasick\MultiStringMatcher;

$keywords = new MultiStringMatcher( array( 'ore', 'hell' ) );
Expand All @@ -19,7 +19,7 @@ $keywords->searchIn( 'She sells sea shells by the sea shore.' );

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


Features
Expand All @@ -32,12 +32,19 @@ 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.

The 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.

See also the definition and reference implementation on [nist.gov][dads].


[paper]: https://doi.org/10.1145/360825.36085
[dads]: http://xlinux.nist.gov/dads/HTML/ahoCorasick.html

Contribute
----------

- Issue tracker: <https://phabricator.wikimedia.org/tag/ahocorasick/>
- Source code: https://github.com/wikimedia/AhoCorasick
- Issue tracker: https://phabricator.wikimedia.org/tag/ahocorasick/
- Source code: https://gerrit.wikimedia.org/g/AhoCorasick


Support
Expand Down
5 changes: 0 additions & 5 deletions build/doxygen_escape.sh

This file was deleted.

1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"@phpcs",
"minus-x check ."
],
"changelog": "git log --format='* %s (%aN)' --no-merges --reverse $(git describe --tags --abbrev=0 HEAD)...HEAD | sort | grep -vE '^\\* (build|docs?|tests?):'",
"cover": "phpunit --coverage-html coverage",
"fix": [
"minus-x fix .",
Expand Down
14 changes: 2 additions & 12 deletions src/MultiStringMatcher.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
<?php
/**
* AhoCorasick PHP Library
*
* A PHP implementation of the Aho-Corasick string matching algorithm.
*
* Alfred V. Aho and Margaret J. Corasick, "Efficient string matching:
* an aid to bibliographic search", CACM, 18(6):333-340, June 1975.
*
* @link http://xlinux.nist.gov/dads//HTML/ahoCorasick.html
* @link https://en.wikipedia.org/wiki/Aho-Corasick_string_matching_algorithm
*
* Copyright (C) 2015 Ori Livneh <[email protected]>
* Copyright 2015 Ori Livneh <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -46,7 +36,7 @@
* Alfred V. Aho and Margaret J. Corasick, "Efficient string matching:
* an aid to bibliographic search", CACM, 18(6):333-340, June 1975.
*
* @link http://xlinux.nist.gov/dads//HTML/ahoCorasick.html
* @link http://xlinux.nist.gov/dads/HTML/ahoCorasick.html
*/
class MultiStringMatcher {

Expand Down
15 changes: 2 additions & 13 deletions src/MultiStringReplacer.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
<?php
/**
* AhoCorasick PHP Library
*
* A PHP implementation of the Aho-Corasick string matching algorithm.
*
* Alfred V. Aho and Margaret J. Corasick, "Efficient string matching:
* an aid to bibliographic search", CACM, 18(6):333-340, June 1975.
*
* @link http://xlinux.nist.gov/dads//HTML/ahoCorasick.html
* @link https://en.wikipedia.org/wiki/Aho-Corasick_string_matching_algorithm
*
* Copyright (C) 2015 Ori Livneh <[email protected]>
* Copyright 2015 Ori Livneh <[email protected]>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -31,8 +21,7 @@
namespace AhoCorasick;

/**
* This class extends MultiStringMatcher, adding search and replace
* functionality.
* Search and replace functionality.
*/
class MultiStringReplacer extends MultiStringMatcher {

Expand Down

0 comments on commit 15a9bba

Please sign in to comment.