All Projects → aarondandy → Wecantspell.hunspell

aarondandy / Wecantspell.hunspell

Licence: other
A port of Hunspell v1 for .NET and .NET Standard

Projects that are alternatives of or similar to Wecantspell.hunspell

Did you mean
The gem that has been saving people from typos since 2014
Stars: ✭ 1,786 (+2827.87%)
Mutual labels:  spellcheck, spell-check
WordSegmentationDP
Word Segmentation with Dynamic Programming
Stars: ✭ 18 (-70.49%)
Mutual labels:  spellcheck, spell-check
Dspellcheck
Notepad++ Spell-checking Plug-in
Stars: ✭ 144 (+136.07%)
Mutual labels:  spellcheck, spell-check
Hunspell
The most popular spellchecking library.
Stars: ✭ 1,196 (+1860.66%)
Mutual labels:  spellcheck, spell-check
SymSpellCppPy
Fast SymSpell written in c++ and exposes to python via pybind11
Stars: ✭ 28 (-54.1%)
Mutual labels:  spellcheck, spell-check
Symspell
SymSpell: 1 million times faster spelling correction & fuzzy search through Symmetric Delete spelling correction algorithm
Stars: ✭ 1,976 (+3139.34%)
Mutual labels:  spellcheck, spell-check
spell
Spelling correction and string segmentation written in Go
Stars: ✭ 24 (-60.66%)
Mutual labels:  spellcheck, spell-check
Spelling
Tools for Spell Checking in R
Stars: ✭ 82 (+34.43%)
Mutual labels:  spellcheck, spell-check
check-spelling
Spelling checker action
Stars: ✭ 139 (+127.87%)
Mutual labels:  spellcheck, spell-check
LinSpell
Fast approximate strings search & spelling correction
Stars: ✭ 52 (-14.75%)
Mutual labels:  spellcheck, spell-check
Pylanguagetool
Python Library and CLI for the LanguageTool JSON API
Stars: ✭ 62 (+1.64%)
Mutual labels:  spellcheck, spell-check
Symspellcompound
SymSpellCompound: compound aware automatic spelling correction
Stars: ✭ 61 (+0%)
Mutual labels:  spellcheck, spell-check
Misspell Fixer
Simple tool for fixing common misspellings, typos in source code
Stars: ✭ 154 (+152.46%)
Mutual labels:  spellcheck, spell-check
spellchecker-wasm
SpellcheckerWasm is an extrememly fast spellchecker for WebAssembly based on SymSpell
Stars: ✭ 46 (-24.59%)
Mutual labels:  spellcheck, spell-check
Dictionaries
Hunspell dictionaries in UTF-8
Stars: ✭ 591 (+868.85%)
Mutual labels:  spellcheck, spell-check
Symspellpy
Python port of SymSpell
Stars: ✭ 420 (+588.52%)
Mutual labels:  spellcheck, spell-check
Portmapper
A tool for managing port forwardings via UPnP
Stars: ✭ 416 (+581.97%)
Mutual labels:  port
Grazi
Grammar checking and more for IntelliJ IDEA
Stars: ✭ 32 (-47.54%)
Mutual labels:  spellcheck
Tomb5
Tomb Raider: Chronicles Disassembly translated to C source code.
Stars: ✭ 397 (+550.82%)
Mutual labels:  port
Ivim
A vim port to iOS.
Stars: ✭ 389 (+537.7%)
Mutual labels:  port

WeCantSpell: Hunspell

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

bee

Download and install with NuGet: WeCantSpell.Hunspell

Build status NuGet version

Features

  • 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

License

"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");
    }
}

Upstream

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

Performance

"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;
    }
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].