{"id":26349594,"url":"https://github.com/willibrandon/spellcheck32","last_synced_at":"2026-05-22T14:12:46.387Z","repository":{"id":215004792,"uuid":"737880219","full_name":"willibrandon/spellcheck32","owner":"willibrandon","description":"A .NET wrapper around the Microsoft Spell Checking API.","archived":false,"fork":false,"pushed_at":"2024-11-25T06:40:39.000Z","size":825,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-04T17:54:35.901Z","etag":null,"topics":["dictionary","dotnet","spellcheck","spellchecker","spelling","suggestions","win32"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/willibrandon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-01T20:36:49.000Z","updated_at":"2024-11-25T06:40:42.000Z","dependencies_parsed_at":"2024-11-18T09:35:11.617Z","dependency_job_id":null,"html_url":"https://github.com/willibrandon/spellcheck32","commit_stats":null,"previous_names":["willibrandon/spellcheck32"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willibrandon%2Fspellcheck32","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willibrandon%2Fspellcheck32/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willibrandon%2Fspellcheck32/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/willibrandon%2Fspellcheck32/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/willibrandon","download_url":"https://codeload.github.com/willibrandon/spellcheck32/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243847369,"owners_count":20357362,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dictionary","dotnet","spellcheck","spellchecker","spelling","suggestions","win32"],"created_at":"2025-03-16T09:18:53.946Z","updated_at":"2026-05-22T14:12:38.335Z","avatar_url":"https://github.com/willibrandon.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# spellcheck32\n\nA .NET wrapper around the Microsoft Spell Checking API\n\n## Example\n\n```csharp\nstring text = \"Cann I I haev some Linux?\";\n\nusing SpellChecker spellChecker = new(\"en-US\");\nspellChecker.AutoCorrect(\"Linux\", \"Windows\");\n\nConsole.WriteLine(string.Concat(\"Check \\\"\", text, \"\\\"\", Environment.NewLine));\n\nforeach (SpellingError error in spellChecker.Check(text))\n{\n    string mistake = text.Substring(error.StartIndex, error.Length);\n\n    switch (error.CorrectiveAction)\n    {\n        case CorrectiveAction.Delete:\n            Console.WriteLine(string.Concat(\"Delete \\\"\", mistake, \"\\\"\", Environment.NewLine));\n            break;\n\n        case CorrectiveAction.GetSuggestions:\n            Console.WriteLine(string.Concat(\"Suggest replacing \\\"\", mistake, \"\\\" with:\"));\n\n            foreach (string suggestion in spellChecker.Suggest(mistake))\n            {\n                Console.WriteLine(string.Concat(\"\\\"\", suggestion, \"\\\"\"));\n            }\n\n            Console.WriteLine(string.Empty);\n            break;\n\n        case CorrectiveAction.Replace:\n            Console.WriteLine(\n                string.Concat(\"Replace \\\"\", mistake, \"\\\" with \\\"\",\n                    spellChecker.Suggest(mistake).First(), \"\\\"\", Environment.NewLine));\n            break;\n\n        case CorrectiveAction.None:\n        default:\n            break;\n    }\n}\n```\n\nOutput:\n```\nCheck \"Cann I I haev some Linux?\"\n\nReplace \"Cann\" with \"Can\"\n\nDelete \"I\"\n\nReplace \"haev\" with \"have\"\n\nReplace \"Linux\" with \"Windows\"\n```\n\n## API\n\n```csharp\nnamespace spellcheck32;\n\npublic class SpellChecker\n{\n    /// \u003csummary\u003e\n    ///  Occurs when there is a change to the state of the spell checker that could cause the text to be treated differently. A\n    ///  client should recheck the text when this event is received.\n    /// \u003c/summary\u003e\n    public event EventHandler\u003cEventArgs\u003e? SpellCheckerChanged;\n\n    /// \u003csummary\u003e\n    ///  Gets the identifier of the spell checker.\n    /// \u003c/summary\u003e\n    public string Id { get; }\n\n    /// \u003csummary\u003e\n    ///  Gets the BCP47 language tag this instance of the spell checker supports.\n    /// \u003c/summary\u003e\n    public string LanguageTag { get; }\n\n    /// \u003csummary\u003e\n    ///  Gets text, suitable to display to the user, that describes this spell checker.\n    /// \u003c/summary\u003e\n    public string LocalizedName { get; }\n\n    /// \u003csummary\u003e\n    ///  Creates a new instance of the \u003csee cref=\"SpellChecker\"/\u003e class.\n    /// \u003c/summary\u003e\n    /// \u003cparam name=\"languageTag\"\u003e\n    ///  A BCP47 language tag that identifies the language for the requested spell checker.\n    /// \u003c/param\u003e\n    public SpellChecker(string languageTag)\n\n    /// \u003csummary\u003e\n    ///  Treats the provided word as though it were part of the original dictionary.\n    /// \u003c/summary\u003e\n    /// \u003cremarks\u003e\n    /// \u003cpara\u003e\n    ///  The word will no longer be considered misspelled, and will also be considered as a candidate for suggestions.\n    /// \u003c/para\u003e\n    /// \u003c/remarks\u003e\n    public void Add(string word)\n\n    /// \u003csummary\u003e\n    ///  Causes the occurrences of one word to be replaced by another.\n    /// \u003c/summary\u003e\n    /// \u003cparam name=\"from\"\u003e\n    ///  The incorrectly spelled word to be autocorrected.\n    /// \u003c/param\u003e\n    /// \u003cparam name=\"to\"\u003e\n    ///  The correctly spelled word that should replace \u003cparamref name=\"from\"/\u003e.\n    /// \u003c/param\u003e\n    public void AutoCorrect(string from, string to)\n\n    /// \u003csummary\u003e\n    ///  Checks the spelling of the supplied text and returns a collection of spelling errors.\n    /// \u003c/summary\u003e\n    public IEnumerable\u003cSpellingError\u003e Check(string text)\n\n    /// \u003csummary\u003e\n    ///  Checks the spelling of the supplied text in a more thorough manner than \u003csee cref=\"Check(string)\"/\u003e, and returns a\n    ///  collection of spelling errors.\"/\u003e\n    /// \u003c/summary\u003e\n    public IEnumerable\u003cSpellingError\u003e ComprehensiveCheck(string text)\n\n    /// \u003csummary\u003e\n    ///  Ignores the provided word for the rest of this session.\n    /// \u003c/summary\u003e\n    /// \u003cremarks\u003e\n    /// \u003cpara\u003e\n    ///  The word will no longer be considered misspelled, but it will not be considered as a candidate for suggestions.\n    /// \u003c/para\u003e\n    /// \u003c/remarks\u003e\n    public void Ignore(string word)\n\n    /// \u003csummary\u003e\n    ///  Determines whether the specified language is supported by a registered spell checker.\n    /// \u003c/summary\u003e\n    /// \u003cparam name=\"languageTag\"\u003e\n    ///  A BCP47 language tag that identifies the language for the requested spell checker.\n    /// \u003c/param\u003e\n    /// \u003creturns\u003e\n    ///  \u003csee langword=\"true\"/\u003e if the specified language is supported by a registered spell checker, otherwise\n    ///  \u003csee langword=\"false\"/\u003e.\n    /// \u003c/returns\u003e\n    public bool IsLanguageSupported(string languageTag)\n\n    /// \u003csummary\u003e\n    ///  Registers a file to be used as a user dictionary for the current user, until unregistered.\n    /// \u003c/summary\u003e\n    /// \u003cremarks\u003e\n    /// \u003cpara\u003e\n    ///  Allows clients to persistently register and unregister user dictionary files that exist in locations other than the\n    ///  usual directory path (%AppData%\\Microsoft\\Spelling). The dictionaries must have the same files formats as the ones\n    ///  located in the normal path and also should have the appropriate file extensions. However, it is strongly recommended\n    ///  for clients to place their dictionaries under %AppData%\\Microsoft\\Spelling whenever it is possible--the spell checking\n    ///  functionality does not pick up changes in dictionaries outside that directory tree.\n    /// \u003c/para\u003e\n    /// \u003cpara\u003e\n    ///  The filename must have the extension .dic (added words), .exc (excluded words), or .acl (autocorrect word pairs). The\n    ///  files are UTF-16 LE plaintext that must start with the aprropriate Byte Order Mark (BOM). Each line conains a word (in\n    ///  the Added and Excluded word lists), or an autocorrect pair with the words separated by a vertical var (\"|\") (in the\n    ///  AutoCorrect word list). The wordlist in which the dictionary is included is inferred through the file extension.\n    /// \u003c/para\u003e\n    /// \u003cpara\u003e\n    ///  A file registered for a language subtag will be picked up for all languages that contain it. For example, a dictionary\n    ///  registered for \"en\" will also be used by an \"en-US\" spell checker.\n    /// \u003c/para\u003e\n    /// \u003c/remarks\u003e\n    public void RegisterUserDictionary(string dictionaryPath, string languageTag)\n\n    /// \u003csummary\u003e\n    ///  Removes a word that was previously added by \u003csee cref=\"Add(string)\"/\u003e, or set by \u003csee cref=\"Ignore(string)\"/\u003e to be\n    ///  ignored.\n    /// \u003c/summary\u003e\n    public void Remove(string word)\n\n    /// \u003csummary\u003e\n    ///  Retrieves spelling suggestions for the supplied text.\n    /// \u003c/summary\u003e\n    public IEnumerable\u003cstring\u003e Suggest(string word)\n\n    /// \u003csummary\u003e\n    ///  Gets the set of languages/dialects supported by any of the registered spell checkers.\n    /// \u003c/summary\u003e\n    public IEnumerable\u003cstring\u003e SupportedLanguages()\n\n    /// \u003csummary\u003e\n    ///  Unregisters a previously registered user dictionary. The dictionary will no longer be used by the spell checking\n    ///  functionality.\n    /// \u003c/summary\u003e\n    /// \u003cremarks\u003e\n    /// \u003cpara\u003e\n    ///  To unregister a given file, this method must be passed the same arguments that were previously used to register it.\n    /// \u003c/para\u003e\n    /// \u003c/remarks\u003e\n    public void UnregisterUserDictionary(string dictionaryPath, string languageTag)\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillibrandon%2Fspellcheck32","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwillibrandon%2Fspellcheck32","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwillibrandon%2Fspellcheck32/lists"}