NetSpell拼写检查 [英] NetSpell spellchecker

查看:239
本文介绍了NetSpell拼写检查的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人尝试这个库的呢?我无法得到它的工作。例如,拼写建议应该工作如下:

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文件(x86)\Common Files\microsoft
shared\DevServer\10.0\en-us.dic

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;

的推荐方法应该得到'海峡'的建议和填充建议性质。我总是得到0建议。我想,该库支持,看看能否做任何事情,你可以看到所有的三个建议类型,但是这并不能工作。

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.

即使是简单的通话,如

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.

推荐答案

这是什么是时,DIC文件不兼容。我只是用自带当你下载NetSpell,它就像一个魅力的人。

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.

顺便说一句,我SwitchE上以NHunspell,我喜欢它远远超过NetSpell更好。更易于使用和更好的建议。
http://www.crawler-lib.net/nhunspell

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

这篇关于NetSpell拼写检查的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆