pyahocorasick | Python module ( C extension | Natural Language Processing library
kandi X-RAY | pyahocorasick Summary
kandi X-RAY | pyahocorasick Summary
Python module (C extension and plain python) implementing Aho-Corasick algorithm
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of pyahocorasick
pyahocorasick Key Features
pyahocorasick Examples and Code Snippets
Community Discussions
Trending Discussions on pyahocorasick
QUESTION
I´m new at python and I don´t know how to program well. How do I edit this code so it can works using pyahocorasick? My code is very slow, because I need to search lots of strings at a very big file. Any other way to improve the search?
...ANSWER
Answered 2020-Feb-28 at 17:16After looking at your files, it looks like each line in the dict_search.txt file match with the format of second column in source.txt file. If this is the case, the below code will work for you. It's a linear time solution so it's going to be fast on the cost of space because it creates dictionary in memory.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install pyahocorasick
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page