AcTrie 0.2.1

dotnet add package AcTrie --version 0.2.1
                    
NuGet\Install-Package AcTrie -Version 0.2.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AcTrie" Version="0.2.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AcTrie" Version="0.2.1" />
                    
Directory.Packages.props
<PackageReference Include="AcTrie" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AcTrie --version 0.2.1
                    
#r "nuget: AcTrie, 0.2.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package AcTrie@0.2.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=AcTrie&version=0.2.1
                    
Install as a Cake Addin
#tool nuget:?package=AcTrie&version=0.2.1
                    
Install as a Cake Tool

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<string, TValue> 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 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

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net7.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.1 191 11/8/2024
0.2.0 158 11/8/2024
0.1.0 203 8/9/2024

# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
## [0.2.1] - 2024-11-08
### Fixed
- Fixed a bug in `AhoCorasick` that would cause errors when using `ContainsKey` or `TryGetValue` when the key did not exist in the Trie.
## [0.2.0] - 2024-11-08
### Added
- Added a changelog
### Changed
- Renamed `ACTrie` to `AhoCorasick` to avoid collision with package namespace
- Removed `struct` constraint on `Trie` and `AhoCorasick` type parameters
- Changed signature of `Trie.ConsumeLongestPrefix` method to return a `Match` type on success or null on failure.
## [0.1.0] - 2024-08-09
### Added
- `Trie` class which implements dictionary interface and allows finding longest prefixes
- `ACTrie` class which implements an Aho-Corasick automaton
[unreleased]: https://github.com/raineszm/actrie/compare/0.2.1...HEAD
[0.2.0]: https://github.com/raineszm/actrie/releases/tag/0.1.0...0.2.0
[0.1.0]: https://github.com/raineszm/actrie/releases/tag/0.1.0