Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/raineszm/actrie
a simple implementation of the Aho-Corasick algorithm in C#
https://github.com/raineszm/actrie
Last synced: 6 days ago
JSON representation
a simple implementation of the Aho-Corasick algorithm in C#
- Host: GitHub
- URL: https://github.com/raineszm/actrie
- Owner: raineszm
- Created: 2023-06-23T19:34:50.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-08T16:43:51.000Z (about 2 months ago)
- Last Synced: 2024-11-08T17:37:08.057Z (about 2 months ago)
- Language: C#
- Size: 72.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# AcTrie
This library provides a naive implementation of as the Aho-Corasick algorithm for string searching
as well as a simple implementation of a compressed radix trie.## Usage
### Trie
The `Trie` module defines a compressed radix tree mapping string keys to a generic value. This class implements the
`IDictionary` interface. Additionally it implements the `ConsumeLongestPrefix` method, which returns the
value corresponding to the key matching the longest prefix as well as the remaining text.### AcTrie
The `AcTrie` module defines an `AcTrie` class implementing the `IDictionary` interface, generic over the key and value.
Additionally `AcTrie` implements an [Aho-Corasick](https://en.wikipedia.org/wiki/Aho%E2%80%93Corasick_algorithm) state
machine.
This functionality is used to provide the `Search` and `LongestMatch` methods.## Contributing
Pull requests are welcome. For major changes, please open an issue first
to discuss what you would like to change.Please make sure to update tests as appropriate.
## License
[MIT](https://choosealicense.com/licenses/mit/)