Commits

aarondandy committed 385a473

Trying to fix the issue with my work computer, maybe this will work.

  • Participants
  • Parent commits e93ddfa

Comments (0)

Files changed (2)

 --------
 ============== ============ ============ ===========
 VS Verstion:   VS 2012 (11) VS 2010 (10) VS 2008 (9)
-ReSharper v6.1 Maybe        Yep          Probably
+ReSharper v6.1 Maybe        Yep          Yep
 ReSharper v7.0 Maybe        Yep          Probably
 ============== ============ ============ ===========
 
 -  ASPX
 - XML (AppConfig)
 
+Problems
+--------
+Only en-US is supported right now. That is the next thing I want to fix.
+
 Notes
 -----
 Uses NHunspell: http://nhunspell.sourceforge.net/

File src/YouCantSpell.Core/SpellChecker.cs

 		private static IEnumerable<string> GetPluginFolderSearchPaths()
 		{
 			var assembly = typeof (SpellChecker).Assembly;
-			yield return Path.GetDirectoryName(Path.GetDirectoryName(assembly.Location));
-			yield return Path.GetDirectoryName(new Uri(assembly.CodeBase).AbsolutePath);
+			yield return Path.GetDirectoryName(assembly.Location);
+			var codeBaseUri = new Uri(assembly.CodeBase);
+			yield return Path.GetDirectoryName(codeBaseUri.LocalPath);
+			yield return Path.GetDirectoryName(codeBaseUri.AbsolutePath);
 		}
 
 		private static bool PathContainsDictionaryFolder(string path)
 		{
-			if(!Directory.Exists(path))
+			if(String.IsNullOrEmpty(path) || !Directory.Exists(path))
 				return false;
 			var dicDir = Path.Combine(path, DicFolderName);
 			return Directory.Exists(dicDir) && Directory.GetFiles(dicDir, "*.dic").Any();
 		public SpellChecker()
 		{
 			var dictionaryFolder = FindDictionaryPath();
+			if(String.IsNullOrEmpty(dictionaryFolder))
+				throw new InvalidOperationException("Dictionary folder not found!");
+
 			_core = new Hunspell(
 				Path.Combine(dictionaryFolder, "en_US.aff"),
 				Path.Combine(dictionaryFolder, "en_US.dic")