pyahocorasick
pyahocorasick copied to clipboard
Python module (C extension and plain python) implementing Aho-Corasick algorithm
This PR fixes a compiler warning created by negating an unsigned integer before casting it to a signed integer. This is fixed by explicitly casting the unsized integer to a...
I added a mingw declarations file to support that platform. It was copied from the cygwin definitions. I appear to be able to compile, load, and use this library from...
Please, someone, build Python 3.12 wheels.
After fix #174 which is discussed in #133. I found the code below ``` source_text = 'zzabcabdzz' A = ahocorasick.Automaton() for k in ['ab', 'abcabd']: A.add_word(k, k) A.make_automaton() list(A.iter_long(source_text)) ```...
``` automaton = ahocorasick.Automaton() input='👨👨👦' for c in input: automaton.add_word(c, c) automaton.add_word(input, input) automaton.make_automaton() for end_index, value in automaton.iter_long(input): end_index += 1 start_index = end_index - len(value) print('FOUND', start_index, end_index,...
Fix #185 The idea is to cache the first fail_node during iteration. Later if a last_node is found (meaning a match, surely longest), the cached fail_node is not used and...
I installed the latest version of pyahocorasick: ``` (ternenv) rose@rose-vm:~/ternenv$ pip install pyahocorasick --no-cache-dir Collecting pyahocorasick Downloading pyahocorasick-2.0.0.tar.gz (99 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 99.7/99.7 kB 1.8 MB/s eta 0:00:00 Preparing metadata (setup.py)...
As follow up to https://github.com/WojciechMula/pyahocorasick/pull/175 we need to have some tests for the mingw build. > @pombredanne left a comment > > Thanks! > Do you think we could also...
Originally posted by @Azzonith in https://github.com/WojciechMula/pyahocorasick/issues/81#issuecomment-1157813973_ Hello, Can confirm memory leak issue exists in 1.4.4 and it might have something to do with pickling, tracemalloc output: [ Top 10 ]...
```py [ 49s] =================================== FAILURES =================================== [ 49s] _________________ TestUnpickleRaw.test__construct_simple_trie __________________ [ 49s] [ 49s] self = [ 49s] [ 49s] @skipIf(not ahocorasick.unicode, "Run only with unicode build") [ 49s]...