Giter VIP home page Giter VIP logo

ahocorasick's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar mganss avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar

ahocorasick's Issues

How long will it take to create the trie tree?

Did you benchmark how long it will take to create the trie tree if there are many words (eg. 5000words)? This algorithm is useful in dirty/censorship words matching. But usually, the words list can be very long and dynamic (maintainable).

Return after first match

Hey,

I am using your in a project and am currently implementing an algorithm where we only care for getting any one match.
For example, if we have search patterns "aa, ab, abc" and the input string is "aab", then I would only like to know if there is a match and I do not care if it is either "aa" or "ab". So essentially just the search function, which returns its first match. I think this can be a major performance improvement for my case. Could you let me know if you are willing to include this in your library? I can see why you would not like this, as it kind of goes against the main idea of the AhoCorasick algorithm, but it would be nice to have for me.

excessive memory consumption due to enumerator creation

Hey

I was trying out the library for a project that I'm doing and I saw that is has a large memory traffic when searching for a long keyword in a large text.

It boils down to the the Line 177 https://github.com/mganss/AhoCorasick/blob/master/AhoCorasick/AhoCorasick.cs#L177 where you call the Match function which itself returns an IEnumerable.
Due to the amount of times this gets executed, a lot of Enumerators get created.

I was able to fix this by copying the code of the Match function inside the Search function. This gets rid of the Enumerator creation and the allocations are gone.

Hope this helps

Wildcard matching

Do you think it would be easy to add wildcard matching to this? Any tips how it might be achieved?

Thinking * for any number of characters, and ? For a single character.

Index out of bounds

any clue how to handle this, is the input in wrong format or what's goin on here? :)

image

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.