Skip to content

Commit

Permalink
update README for new acascii
Browse files Browse the repository at this point in the history
  • Loading branch information
client9 committed Oct 25, 2019
1 parent 559fb34 commit a8cf593
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

[![GoDoc](https://godoc.org/github.com/signalsciences/ac?status.svg)](https://godoc.org/github.com/signalsciences/ac) [![Build Status](https://travis-ci.org/signalsciences/ac.svg?branch=master)](https://travis-ci.org/signalsciences/ac)

Golang implementation of Aho-Corasick for rapid substring matching on byte
strings.
Golang implementation of Aho-Corasick for rapid substring matching on either byte
strings or ASCII strings.

This is based on the excellent library
[cloudflare/ahocorasick](https://github.com/cloudflare/ahocorasick) (BSD
License). The fork/changes were needed for a specific application usages
that are incomptabile with the original library.
that are incomptabile with the original library. Some other minor optimizations
around memory and setup were also done.

## Examples

Expand Down Expand Up @@ -40,16 +41,17 @@ Output:
true
```

## NOTES
## ac/acascii for pure ASCII matching

The `ac/acascii` package assumes the dictionary is all ASCII characters (1-127) without NULL bytes. This results in during setup:

* 50% less memory allocations
* 50% less memory users
* 50% less CPU time

as compared to the plain `ac` package.

* This is designed for ASCII pattern matching at the byte level.
There is no rune support, no UTF-8 support (other than the ASCII subset).
* Similar API to `regexp` package.
* Byte and String-based API work the same. Again, there is no UTF-8 support.

## IN PROGRESS

* Current API allows for *overlapping* matches. This is slow
and potentially exponential and is different than how golang's
regular expressions work. This will be changed.
* Support for ASCII case-insensitive matching.

0 comments on commit a8cf593

Please sign in to comment.