我创建了一个项目,在其中输入一个单词并使用 Hunspell.dll 类进行拼写检查。请注意,我通过 xamarin studio IDE(FOR MAC)从一个包中下载了这个 dll。我还下载了该类检查单词所需的 .aff 和 .dic 文件并将它们添加到我的调试文件夹中,但是当我编译应用程序时出现以下错误:System.EntryPointNotFoundException。如果您有任何想法,请告诉我。
这是我的代码:
using NHunspell;
public static void Main(string[] args)
{
string line = Console.ReadLine();
using (Hunspell hunspell = new Hunspell("en_us.aff", "en_us.dic"))
{
bool correct = hunspell.Spell(line);
Console.WriteLine(line + " is spelled " + (correct ? "correct" : "not correct"));
}
}