3

Does anybody have any ideas of a good way to implement Hunspell in Silverlight? I see some 3rd party TextBox controls available for purchase, however I'm just looking to utilize Hunspell in the backend.

Dave Clemmer
  • 3,741
  • 12
  • 49
  • 72
b9190db9
  • 153
  • 2
  • 7

1 Answers1

0

Design a WCF Ria Services that a list of misspelled words and their suggestions. Then it is a matter of figuring out how to highlight the mispelled words.

[Invoke]
public IEnumerable<WrongWord> SpellCheck(string Passage)
{
}

public class WrongWord
{
  [Key] public property int Id {get; set; }
  public string Word {get; set; }
  public IEnumerable<string> Suggestions {get; set; }
}

You probably can use the .NET bindings, e.g. http://nhunspell.sourceforge.net/ or you can wrap hunspell yourself.

Chui Tey
  • 5,436
  • 2
  • 35
  • 44
  • Thanks Chui. Do you mean to suggest doing the spellchecking through services only? Unfortunately my app has to support offline use so I'd need silverlight code to be able to do so. RIA implies service usage, yes? – b9190db9 Jan 09 '12 at 19:14
  • If you need to run spell checker offline, then you need a .NET native library (which hunspell isn't), or run OOB or with elevated privilege and then use pInvoke. – Chui Tey Jan 10 '12 at 05:54
  • Thanks again Chui. However I don't think I can pinvoke any libraries in SL4. – b9190db9 Jan 11 '12 at 17:20