WojciechMula / pyahocorasick

Python module (C extension and plain python) implementing Aho-Corasick algorithm
BSD 3-Clause "New" or "Revised" License
927 stars 122 forks source link

C interface of this repo #121

Closed GavynDracula closed 4 years ago

GavynDracula commented 4 years ago

I am searching the Github for a good C implementation of the Aho-Corasick algorithm, but currently no one is suitable. I have used pyahocorasick in my python program before, and I am familiar with its interfaces. Since pyahocorasick is realized on the basis of cython, so I wonder whether it is possible for this repo to expose C interface as well...

WojciechMula commented 4 years ago

Hi, I was thinking about that, but the current implementation is too coupled with Python C API. I would rather rewrote everything in C++ and then expose Python and C interfaces.

GavynDracula commented 4 years ago

Hi, I was thinking about that, but the current implementation is too coupled with Python C API. I would rather rewrote everything in C++ and then expose Python and C interfaces.

Wow, that is really cool. I am looking forward to it. Thanks.

mingzian commented 3 years ago

Just wanted to double check if there are there any plans for a C or C++ API? The best implementation of the algo I know is pyahocorasick, so it would be really great to have it available in C or C++ as well!

WojciechMula commented 3 years ago

I considering only C++ (and then some C wrapper), as C++ template would easily let to experiment with different memory layouts, allocators, data types etc. As a side effect, it would allow having a more robust Python solution.