GitShow/BurntSushi/aho-corasick
BurntSushi

aho-corasick

A fast implementation of Aho-Corasick in Rust.

by BurntSushi
aho-corasickfinite-state-machinesearchsubstring-matchingtext-processing
Star on GitHubFork

Rust

1.3k stars121 forks36 contributorsActive · 1mo agoSince 2015Unlicense

Meet the team

See all 36 on GitHub →
BurntSushi
BurntSushi245 contributions
andrew-d
andrew-d6 contributions
Marwes
Marwes4 contributions
atouchet
atouchet3 contributions
GuillaumeGomez
GuillaumeGomez3 contributions
jneem
jneem3 contributions
ruuda
ruuda3 contributions
Ten0
Ten02 contributions

Languages

View on GitHub →
Rust100%

Commit activity

Last 12 weeks · 4 commits

Full graph →

Community health

2 of 6 standards met

Community profile →
42
✓README✓License○Contributing○Code of Conduct○Issue Template○PR Template

Recent PRs & issues

Active · Last activity 1mo ago
See all on GitHub →
TrueFurina
docs: document the start-bound panic case in Input::set_rangeOpenPR

Closes #176 (docs direction per the maintainer's comment: "This can just be added as new documentation"). Background 's section only exemplified the end-bound case (). The symmetric start-bound case is reachable the same way: a custom impl returning from hits in and panics with (src/util/search.rs:380). Change (docs-only) The section of now also documents the start-bound case, notes that range syntax cannot produce such a bound but any custom implementation can, and that it is not specially handled. An inline comment asking "Can this case ever happen?" is thereby answered by the docs as well. No code behavior is changed; matching the maintainer's chosen resolution for #176. (#175's already has a section on master, so no change was needed there.) Verification on the crate with this change applied: 102 passed / 0 failed / 5 ignored

TrueFurina · 4d ago
chad-loder
packed: support ascii_case_insensitiveOpenPR

Closes #187. declined the packed prefilter outright (), so caseless searches ran the automaton unaccelerated. The ASCII case bit (0x20) lives in a byte's high nibble, so a caseless pattern shares its low-nibble mask entry with its other case and only the high-nibble entry widens. Same instruction sequence at search time, no runtime cost. The change is: — mask builders also add for ASCII letters, in both the slim and fat paths. — candidate verification case-folds. — the short-haystack fallback folds in its hash and its verifier, so it agrees with the masks. — , threaded to . — removes the two case-insensitive bail-outs. Non-letters still compare exactly. /` `[{]}^~_packed/tests.rspacked/teddy/README.md` already describes.

chad-loder · 1w ago
chad-loder
packed: support `ascii_case_insensitive`OpenIssue

currently disables the packed prefilter (), so caseless searches run the automaton unaccelerated. Patch enables it. The ASCII case bit (0x20) lives in a byte's high nibble, so a caseless pattern shares its low-nibble mask entry with its other case and only the high-nibble entry widens — same instruction sequence, no runtime cost. Candidate verification case-folds to match. Non-letters still compare exactly: /` `[{^~ascii_case_insensitive(true)packed::Config::ascii_case_insensitive(bool)packed/teddy/README.md`. ~160 lines across 5 files plus tests. PR follows.

chad-loder · 1w ago

Recent fixes

View closed PRs →
BurntSushi
lint: remove uses of deprecated module integer constantsMergedPR
BurntSushi · 1mo ago
BurntSushi
lint: fix a few warningsMergedPR

This removes an unused constant in the SIMD abstraction layer and fixes some lifetime elision warnings.

BurntSushi · 1mo ago
tautschnig
api: check for overflow in Match::offset tooMergedPR

Commit 0f3f5da ("api: document a couple panicking preconditions") documented the overflow panic of and made it explicit via , but kept the unchecked additions. Consequently, with debug assertions enabled it panics with the generic "attempt to add with overflow" message rather than the documented one, and in release builds it silently produces a wrapped, nonsensical span instead of panicking: This PR delegates to and documents the panic in the same style. Test suite passes. Found by running Kani's autoharness (model-checking/kani#3832) over aho-corasick 1.1.4, where both methods were reported; is already fixed on main, so only remained.

tautschnig · 1mo ago
Structured data for AI agents

Repository: BurntSushi/aho-corasick. Description: A fast implementation of Aho-Corasick in Rust. Stars: 1291, Forks: 121. Primary language: Rust. Languages: Rust (100%). License: Unlicense. Topics: aho-corasick, finite-state-machine, search, substring-matching, text-processing. Open PRs: 12, open issues: 9. Last activity: 1mo ago. Community health: 42%. Top contributors: BurntSushi, andrew-d, Marwes, atouchet, GuillaumeGomez, jneem, ruuda, Ten0, adetaylor, allaboutevemirolive and others.

·@ofershap

Replace github.com with gitshow.dev