主要算法如代碼所示
以下是引用片段:
private static Dictionary dic = new Dictionary();
private static BitArray fastcheck = new BitArray(char.MaxValue);
static void Prepare()
{
string[] badwords = // read from file
foreach (string word in badwords)
{
if (!dic.ContainsKey(word))
{
dic.Add(word, null);
文章來源于領測軟件測試網 http://www.kjueaiud.com/