我已使用以下代码进行拼写检查。
当我运行它时,我得到一个DLLFileNotFound
异常:
“未找到 Hunspell 英特尔 32 位 DLL:C:\project\splee\Hunspellx86.dll”。
代码片段:
using (Hunspell hunspell = new Hunspell("en_us.aff", "en_us.dic"))
{
bool correct = hunspell.Spell("Recommendation");
var suggestions = hunspell.Suggest("Recommendation");
foreach (string suggestion in suggestions)
{
Console.WriteLine("Suggestion is: " + suggestion);
}
}
// Hyphen
using (Hyphen hyphen = new Hyphen("hyph_en_us.dic"))
{
var hyphenated = hyphen.Hyphenate("Recommendation");
}
using (MyThes thes = new MyThes("th_en_us_new.idx", "th_en_us_new.dat"))
{
using (Hunspell hunspell = new Hunspell("en_us.aff", "en_us.dic"))
{
ThesResult tr = thes.Lookup("cars", hunspell);
foreach (ThesMeaning meaning in tr.Meanings)
{
Console.WriteLine(" Meaning: " + meaning.Description);
foreach (string synonym in meaning.Synonyms)
{
Console.WriteLine(" Synonym: " + synonym);
}
}
}
我在项目中做了参考Hunspell.dll
。怎么了?