Coder Social home page Coder Social logo

ahocorasick's Introduction

Hi There👋

My Tech

Languages

Java Python Go C C++ JavaScript SQL

Technologies

Linux Docker Kubernetes AWS

MySQL Redis MongoDB Elastic Search RabbitMQ Kafka

Spring Boot Spring Webflux Django Flask

React

Recently interesting

  • Virtual Thread

Followers

ahocorasick's People

Contributors

hi-morimoto-i avatar jedld avatar lettuce-program avatar morenice avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ahocorasick's Issues

Missing matching texts

The engine does not locate all texts:
in sample_code():
If you add:
aho_add_match_text(&aho, "b", 1);
The text "b" will not be located.

It seems the code will return only return one result for each last matching letter

Additional example:
aho_add_match_text(&aho, "dab", 3);
The code wil not return a match for "ab" anymore

How can I access the machine states?

I want to check if there is a goto transition between state s and state t for some input character a.

Also if there is a failure transition from some state s to state t.

variable id set but not used

What is the purpose of id? How do you use it?
src/main.c: In function ‘sample_code’: src/main.c:29:9: warning: variable ‘id’ set but not used [-Wunused-but-set-variable] 29 | int id[10] = {0}; | ^~ src/main.c: In function ‘sample_code2’: src/main.c:50:9: warning: variable ‘id’ set but not used [-Wunused-but-set-variable] 50 | int id[10] = {0}; | ^~ src/main.c: In function ‘sample_code3’: src/main.c:73:9: warning: variable ‘id’ set but not used [-Wunused-but-set-variable] 73 | int id[10] = {0}; | ^~ src/main.c: In function ‘sample_code_bench_file’: src/main.c:97:9: warning: variable ‘id’ set but not used [-Wunused-but-set-variable] 97 | int id[10] = {0}; | ^~ src/main.c: In function ‘sample_code_thread’: src/main.c:143:9: warning: variable ‘id’ set but not used [-Wunused-but-set-variable] 143 | int id[10] = {0}; | ^~

Seg fault on a test case

text: Lorem ipsum dolor sit amet, consectetur brown elit. Proin vehicula brown egestas. Aliquam a dui tincidunt, elementum sapien in, ultricies lacus. Phasellus congue, sapien nec

match text:
consectetur
Proin
egestasAliquam
elementum
ultricies
vehicula

Added a PR which replicates this issue: #1

different result to fgrep

$ time ./ahocorasick
280503
./ahocorasick  1.29s user 0.08s system 99% cpu 1.364 total
$ time fgrep -c -e 1984 -e 1985 googlebooks-eng-all-1gram-20120701-0
280457
fgrep -c -e 1984 -e 1985 googlebooks-eng-all-1gram-20120701-0  9.76s user 0.06s system 99% cpu 9.846 total

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.