-3

In my project I need to check a bunch of text for spelling mistakes. I get the text over a webservice and have no GUI component from which I could use Spellchecking functionality.

Is there a standard spell checking function that I can use? Is there a commercial or better open source library that can be used offline?

CDspace
  • 2,639
  • 18
  • 30
  • 36
Martin
  • 53
  • 1
  • 9
  • 5
    Literally google'd "C# spellcheck" and it answered your question. Would have taken you less time than typing up this post :-) https://msdn.microsoft.com/en-us/library/system.windows.controls.spellcheck(v=vs.110).aspx – James Gould Nov 28 '16 at 15:29
  • I'm sorry for asking, but have you googled this? It seems like a common problem –  Nov 28 '16 at 15:29
  • @JayGould He has no gui, and what you linked to works on text controls so I don't think that will work. – Jacobr365 Nov 28 '16 at 15:34
  • @Jacobr365 if that's the case, the problem is incredibly difficult to solve. There would have to be a library somewhere that would *predict* the implied word and replace it, which could lead to all sorts of issues. – James Gould Nov 28 '16 at 15:35
  • @JayGould why would it need to predict anything? Hold string in memory and check its spelling. Also Check out this library http://www.crawler-lib.net/nhunspell this is a spell checking library. It is the spell checker that is used by open office. It can do spell check and make suggestions and so on. – Jacobr365 Nov 28 '16 at 15:55
  • @Jacobr365 presumably you want a spellchecker to correct spelling, rather than just say "There is a misspelled word in this string" and nothing else. How are you going to make suggestions for correct spelling if there's no GUI? – James Gould Nov 28 '16 at 15:58
  • @JayGould I was just mentioning that it could do that. But based on the way I was reading his question i took it as there was no user interaction (service just pulls strings from a webservice and does something with it). so in the case of changing the misspelled word you could just take the first suggestion because like you said, if there is no gui, there is no way for a human to pick the correct suggestion. – Jacobr365 Nov 28 '16 at 16:08
  • If you don't have a GUI, you don't need a spell checker, you just need a dictionary of words. *Extremely* simple to implement. – Cody Gray - on strike Nov 28 '16 at 16:15
  • @Jacobr365,@mattwew Xavier thanks for your links. We have a GUI in an other project which should the spellcecker via webservice, So I can give feedback regarding correctness and possible suggenstions to the user. I will have a look an NHunspell und Aspell. Thanks – Martin Nov 29 '16 at 06:29
  • @Martin another one for multiple languages: https://tisane.ai, with the offline library docs at https://github.com/tisanelabs/tisanedocs/blob/master/tisane_embedded.md (sorry for the necroposting) - strictly commercial – Vadim Berman Nov 23 '19 at 06:32

1 Answers1

0

GNU Aspell is a stable, open-source spelling checker that includes dictionaries for many languages. The library has a C API, which you could presumably use through P/Invoke.

There is a NuGet GNU Aspell package, which claims to provide a .NET wrapper.

Matthew Xavier
  • 2,108
  • 1
  • 13
  • 18