
Security News
New Website “Is It Really FOSS?” Tracks Transparency in Open Source Distribution Models
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
aho_corasick_matcher
Advanced tools
A Ruby gem for finding strings in text using the Aho-Corasick string matching search.
Aho-Corasick is O(n + m)
where n
is the size of the string to be searched
and m
is the size of the dictionary. This means it's particularly suited for
searching for occurrences of words using large dictionaries, as the runtime
increases only linearly.
It's quite memory-intensive, and building a matcher is expensive – but once it's been built, matching terms is very fast.
Current version: 1.0.2
Supported Ruby versions: 1.8.7, 1.9.2, 1.9.3, 2.0, 2.1, 2.2, jruby-1.7, rbx-2.5
require 'aho_corasick_matcher'
matcher = AhoCorasickMatcher.new(['a', 'b', 'ab'])
matcher.match('aba')
#=> ['a', 'ab', 'b', 'a']
matcher = AhoCorasickMatcher.new(['thistle', 'sift', 'thistles'])
matcher.match('Theophilus thistle, the successful thistle sifter, in sifting a sieve full of un-sifted thistles, thrust three thousand thistles through the thick of his thumb.')
#=> ["thistle", "thistle", "sift", "sift", "sift", "thistle", "thistles", "thistle", "thistles"]
Loosely based on Tim Cowlishaw's implementation of the same algorithm.
Copyright © 2015-2016 Altmetric LLP
Distributed under the MIT License.
FAQs
Unknown package
We found that aho_corasick_matcher demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.