title: Spelling libraries (like hunspell) in UWP Applications?
body: <p>I am porting an application for writers to the UWP platorm. The only piece of the puzzle i have left is the NHunspell library. I use it extensively for spell checking and thesaurus features. I've customized the heck out of it, and created custom dictionaries for various things (i.e. a different dictionary for each writing project). This library is a beautiful thing.</p>
  
  <p>However, I can't seem to include this DLL in my UWP application.</p>
  
  <p>1) Is there a way to force the usage of this DLL? I really do like how the NHunSpell system is set up. It makes common sense and is very fast and easy to use.</p>
  
  <p>2) If not, can anyone recommend a better solution for custom dictionaries, customized spell checking, etc?</p>
  
  <p><strong>Update 3</strong></p>
  
  <p>After considerable update and reading online, I found a link discussing the theory of spell checking. Here is one quick example (the one I used the most).</p>
  
  <p><a href="http://www.anotherchris.net/csharp/how-to-write-a-spelling-corrector-in-csharp/" rel="nofollow">http://www.anotherchris.net/csharp/how-to-write-a-spelling-corrector-in-csharp/</a></p>
  
  <p>After reading this article, taking that base code, and stripping the English words from the Hunspell .dic files, I have created my own spell-checking library that works in UWP.</p>
  
  <p>Once I get it solidified, I will post it as an answer below to donate to the SO community. :)</p>
  
  <p><strong>Update 2</strong></p>
  
  <p>I'm conceding the use of Hunspell. It doesn't look like it is possible at all... are there any other libraries/packages that anyone can suggest? </p>
  
  <p><strong>UPDATE :</strong></p>
  
  <p>I probably need to rephrase the statement that I can't include the DLL: I cannot include the DLL through NuGet. It complains that the DLL is not compatible with the UAP/UWP platform.</p>
  
  <p>I am able to <strong>MANUALLY</strong> include the DLL in my project by linking to an existing DLL (not NuGet). However, that DLL does indeed prove to be incompatible with the UAP platform. A simple call to spellcheck a word works fine in WinForms, but immediately crashes with <code>System.IO.FileNotFoundException</code>. </p>
  
  <p>The constructor of NHunspell does reach out to load the associated <code>.dic</code> and <code>.aff</code> files. However, I have mitigated this by loading the files into memory and then call the alternate constructor which takes a byte array instead of a file name for each of those files. It still crashes, but with a new <code>Method not found</code> error: </p>
  
  <p><code>String System.AppDomain.get_RelativeSearchPath()</code> </p>
  
  <p>I am looking for any spell checking engine that will work within the UAP framework. I would prefer for it to be NHunspell simply for familiarity reasons. However, I'm not blind to the fact that this is becoming increasingly less-possible as an option.</p>
  
  <p>People I work with have suggested that I use the built-in spellchecking options. However, I can't use the built-in Windows 10/TextBox spell checking features (that I know of), because I can't control custom dictionaries and I can't disable things like auto-capitalize and word-replacement (where it replaces the word for you if it thinks it is close enough to the right guess). Those things are chapter-suicide for writers! A writer can turn them off at the OS level, but they may want them on for other apps, just not this one.</p>
  
  <p>Please let me know if there is a work-around for NHunspell. And if you don't know of a work-around, please let me know your best replacement custom spellcheck engine that works within the UAP framework. </p>
  
  <p>As a side note, I also use NHunspell for its thesaurus capability. It works very well in my windows apps. I would also have to replace this functionality as well -- hopefully with the same engine as the spellcheck engine. However, if you know of a good thesaurus engine (but it doesn't spell check), that's good too!</p>
  
  <p>Thank you!!</p>