WeCantSpell.Hunspell 3.0.1

Install-Package WeCantSpell.Hunspell -Version 3.0.1
dotnet add package WeCantSpell.Hunspell --version 3.0.1
<PackageReference Include="WeCantSpell.Hunspell" Version="3.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add WeCantSpell.Hunspell --version 3.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: WeCantSpell.Hunspell, 3.0.1"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install WeCantSpell.Hunspell as a Cake Addin
#addin nuget:?package=WeCantSpell.Hunspell&version=3.0.1

// Install WeCantSpell.Hunspell as a Cake Tool
#tool nuget:?package=WeCantSpell.Hunspell&version=3.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

WeCantSpell: Hunspell

A port of Hunspell v1 for .NET, .NET Standard, and .NET Core.


Download and install with NuGet: WeCantSpell.Hunspell

Build status NuGet version


  • Reads Hunspell DIC and AFF file formats
  • Supports checking and suggesting words
  • Ported to fully managed C#
  • Can be queried concurrently
  • Confusing LGPL, GPL, MPL tri-license
  • Compatible with .NET Core and .NET Standard
  • Compatible with multiple .NET framework versions
  • Uses .NET to handle cultures and encodings


"It's complicated"

Read the license: LICENSE

This library was ported from the original Hunspell source and as a result is licensed under an MPL, LGPL, and GPL tri-license. Read the LICENSE file to be sure you can use this library.

Quick Start Example

using WeCantSpell.Hunspell;

public class Program
    static void Main(string[] args)
        var dictionary = WordList.CreateFromFiles(@"English (British).dic");
        bool notOk = dictionary.Check("teh");
        var suggestions = dictionary.Suggest("teh");
        bool ok = dictionary.Check("the");


To know how up to date this port is, check the hunspell-origin submodule.


"Good enough I guess"

The performance of this port while not fantastic relative to the original binaries and NHunspell is definitely acceptable. If you need better performance you should check out NHunspell.

Benchmark WeCantSpell.Hunspell netcore2.1 WeCantSpell.Hunspell net471 NHunspell
Dictionary Loads /s 🐌 3.51 🐌 3.07 🐇 14.49
Words Checked /s 🐢 636,598 🐢 554,200 🐇 973,043

Note: Measurements taken on a Intel 6700K.

Specialized Examples

Construct from a list:

static void Main(string[] args)
    var words = "The quick brown fox jumps over the lazy dog".Split(' ');
    var dictionary = WordList.CreateFromWords(words);
    bool notOk = dictionary.Check("teh");

Construct from streams:

static void Main(string[] args)
    using(var dictionaryStream = File.OpenRead(@"English (British).dic"))
    using(var affixStream = File.OpenRead(@"English (British).aff"))
        var dictionary = WordList.CreateFromStreams(dictionaryStream, affixStream);
        bool notOk = dictionary.Check("teh");

Encoding Issues

The .NET Framework contains many encodings that can be handy when opening some dictionary or affix files that do not use a UTF8 encoding or were incorrectly given a UTF BOM. On a full framework platform this works out great but when using .NET Core or .NET Standard those encodings may be missing. If you suspect that there is an issue when loading dictionary and affix files you can check the dictionary.Affix.Warnings collection to see if there was a failure when parsing the encoding specified in the file, such as "Failed to get encoding: ISO-8859-15" or "Failed to parse line: SET ISO-8859-15". To enable these encodings, reference the System.Text.Encoding.CodePages package and then use Encoding.RegisterProvider(CodePagesEncodingProvider.Instance) to register them before loading files.

using System.Text;
using WeCantSpell.Hunspell;

class Program
    static Program() => Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);

    static void Main(string[] args)
        var dictionary = WordList.CreateFromFiles(@"encoding.dic");
        bool notOk = dictionary.Check("teh");
        var warnings = dictionary.Affix.Warnings;

NuGet packages (6)

Showing the top 5 NuGet packages that depend on WeCantSpell.Hunspell:

Package Downloads

Weighted Search


A spell checking library for the ScintillaNET.


A .net implementation of a library to read unix BSD fortune-style files. This library will create and read dat files (it uses JSON rather than binary DAT format), discover and assign probabilities for the files with an associated DAT, Rotate the text of offensive fortune files (if preferred), and find random fortunes.


A spell checking library for the ScintillaNET.


A class library to allow to perform a spell check via whatever interface using the WeCantSpell.Hunspell library.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on WeCantSpell.Hunspell:

Repository Stars
This library packages the well-known charting library plotly.js into a razor component that can be used in a Blazor project.
Version Downloads Last updated
3.0.1 308,038 9/6/2018
2.1.0 1,428 8/23/2018
2.0.1 2,397 7/23/2018
2.0.0 5,699 7/1/2017
1.1.0 736 6/20/2017
1.0.0 3,179 5/30/2017