NReco.Text.AhoCorasickDoubleArrayTrie 1.0.1

Fast Aho Corasick algorithm based on Double Array Trie.

Very fast C# implementation of Aho Corasick algorithm based on Double Array Trie: efficient text search of many substrings with O(n) complexity. Automata state may be efficiently serialized to binary stream.

Install-Package NReco.Text.AhoCorasickDoubleArrayTrie -Version 1.0.1
dotnet add package NReco.Text.AhoCorasickDoubleArrayTrie --version 1.0.1
<PackageReference Include="NReco.Text.AhoCorasickDoubleArrayTrie" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NReco.Text.AhoCorasickDoubleArrayTrie --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Release Notes

How to use:

var keywords = new Dictionary<string,int>() { {"are", 1},  {"is", 1}, {"he", 2}, {"she", 2}, {"it", 2}, {"we", 2} };
var matcher = new AhoCorasickDoubleArrayTrie<int>( keywords );
var text = "we are all champions";
matcher.ParseText(text, (hit) => {
 Console.WriteLine("Matched: {0} = {1}", text.Substring(hit.Begin, hit.Length), hit.Value );
});

Version History

Version Downloads Last updated
1.0.1 1,075 12/13/2017
1.0.0 326 12/6/2017