测试代码 using System; using System.Collections.Generic; using Splash; namespace SplashCheck { class Test { static void Main(string[] args) { CheckSpellCorrector(@"../../../../整理资料/glossary.txt"); } static void CheckSpellCorrector(String langGlossaryFile, String langAlphabet = null) { SpellCorrector sc = new SpellCorrector(langAlphabet); Int32 Num = sc.Load(langGlossaryFile); Console.WriteLine("总词条数 = " + Num.ToString()); Console.WriteLine("请输入测试数据,q退出"); while (true) { String word = Console.ReadLine(); if (word == "q") break; Console.WriteLine("纠错结果:"); List<String> result = sc.Correct(word); if (result != null) { foreach (String s in result) { Console.WriteLine(s); } } else { Console.WriteLine("结果为0!!!"); } Console.WriteLine("-----------------------"); } } } }