An ultra-compact string dictionary NuGet Package

DAWG (Directed Acyclic Word Graph) is a data structure for storing and searching large word lists while keeping your memory footprint small and lookups fast.

DawgSharp is an open-source C# implementation featuring a linear time graph reduction algorithm and out-of-the-box persistence support.

The Dawg class is nearly as fast as a HashSet for lookups and is much, much more memory-efficient (factors of 30x - 40x are not uncommon). In a benchmark application it held two million words while consuming only 2Mbytes of RAM. That's only one byte per word! And it's even less on disk.

The Dawg class can be thought of as a read-only Dictionary<string, Value>: it has a ["string"] indexer and implements IEnumerable<KeyValuePair<string, Value>>. One other very useful feature of Dawg (not found in Dictionary) is the ability to quickly find all words that start with a particular prefix: dawg.MatchPrefix("star") could possibly yield "star", "starch", "start", "starting", etc.

This package is provided under the terms of the GNU GPL v3.

Source code and documentation are available on GitHub: https://github.com/bzaar/DawgSharp. Commercial licenses are also available at http://morpher.co.uk.




Got any An ultra-compact string dictionary Question?





Info

Version: 1.7.1
Author(s): morpher
Last Update: Sunday, August 18, 2024
.NET Fiddle: Create the first Fiddle
Project Url: https://github.com/bzaar/DawgSharp
NuGet Url: https://www.nuget.org/packages/DawgSharp


Install
Install-Package DawgSharp
dotnet add package DawgSharp
paket add DawgSharp
DawgSharp Download (Unzip the "nupkg" after downloading)

.NETFramework 3.5
  • No dependencies.
.NETFramework 4.0
  • No dependencies.
netstandard1.2 2 packages depend on this package.


Tags



STATS

must-have-score

1.9

avg-downloads-per-day

15

days-since-last-release

95