Reputation: 2217
Has anyone tried this library out? I cannot get it to work. For example, the spelling suggestions should work as follows.
But I am getting an empty list back. I first got an exception saying
C:\Program Files (x86)\Common Files\microsoft shared\DevServer\10.0\en-us.dic
is missing so I downloaded it from the web. The file I got has a list of thousands of english words and I even tried words from what it in the file and still no luck.
He is some code I tried.
Spelling s = new Spelling();
ArrayList items;
s.MaxSuggestions = 5;
s.SuggestionMode = Spelling.SuggestionEnum.PhoneticNearMiss;
s.Suggest(str);
items = s.Suggestions;
s.SuggestionMode = Spelling.SuggestionEnum.NearMiss;
s.Suggest(str);
items = s.Suggestions;
s.SuggestionMode = Spelling.SuggestionEnum.Phonetic;
s.Suggest(str);
items = s.Suggestions;
The Suggest method is supposed to get suggestions for 'str' and populate the Suggestions property. I am always getting 0 suggestions. I tried all three suggestion types that the library supports to see if that does anything as you can see, but that does not work either.
Even simple calls such as
s.TestWord("book")
give back "false". I think it is not able to use the dictionary file but not sure what else to do about it.
Upvotes: 3
Views: 5326
Reputation: 2217
That is what it was, the dic file was not compatible. I just used the one that comes with when you download NetSpell and it works like a charm.
By the way, I switche to NHunspell and I like it much better than NetSpell. Easier to use and better suggestions. http://www.crawler-lib.net/nhunspell
Upvotes: 4