cloudflare / lua-aho-corasick Goto Github PK
View Code? Open in Web Editor NEWLicense: BSD 3-Clause "New" or "Revised" License
License: BSD 3-Clause "New" or "Revised" License
Hi,
I noticed that The Match_Tmpl not supports MV_ALL_MATCHES.
if (state->is_term) {
if (variant == MV_FIRST_MATCH) {
ac_result_t r;
r.match_begin = idx - state->depth;
r.match_end = idx - 1;
r.pattern_idx = state->is_term - 1;
return r;
}
if (variant == MV_LEFT_LONGEST) {
int match_begin = idx - state->depth;
int match_end = idx - 1;
if (r.match_begin == -1 ||
match_end - match_begin > r.match_end - r.match_begin) {
r.match_begin = match_begin;
r.match_end = match_end;
r.pattern_idx = state->is_term - 1;
}
continue;
}
ASSERT(false && "NYI");
}
What should I do if i want get all patterns that match that given subject
string? Why not implement variant == MV_ALL_MATCHES?
When I see things like -msse4.1
in ./Makefile
, I wonder whether you intend the master branch of this repo for general-purpose usage, e.g. ending up in distribution packages. Should I make similar changes in a fork or shall we generalize it directly here, perhaps in a way that you might keep injecting such flags somehow?
Currently the binaries will end up in knot-resolver packages with these flags (even on ARM :) I suspect this will be a real problem for x86 systems without SSE 4.1, and most users surely won't notice a significant difference in speed if we drop these flags. (I understand you might notice the difference on CloudFlare servers.)
How does this compare to https://github.com/chatid/lua-ahocorasick ?
when I use load_ac.lua in macos, sometimes it will report and generate core file
malloc: *** error for object 0x7f8bbc831400: incorrect checksum for freed object - object was probably modified after being freed
it is not supported by macos, so I hope you it can be compatible for macos
Hi,
Can you provide an example of using this via FFI (e.g. via libac.so)?
License? Copyright headers? Is it cloudflare's original code or a copy of a third party library?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.