[分享]一段我主管写的汗死我的代码
#region 匹配if (mode == 1)
{//标题同正文匹配
isRelate = AutoClass(contentRule, strContent, queHightlightWord);
if (isRelate)
{
int hlwLen = queHightlightWord.Count;
keywords = new string[hlwLen];
for (int sWordled = 0; sWordled < hlwLen; sWordled++)
{
keywords[sWordled] = (string)queHightlightWord.Dequeue();
}
}
else
{
isRelate = AutoClass(titleRule, strTitle, queHightlightWord);
if (isRelate)
{
int hlwLen = queHightlightWord.Count;
keywords = new string[hlwLen];
for (int sWordled = 0; sWordled < hlwLen; sWordled++)
{
keywords[sWordled] = (string)queHightlightWord.Dequeue();
}
}
}
}
else if (mode == 2)
{ //标题匹配
isRelate = AutoClass(titleRule, strTitle, queHightlightWord);
if (isRelate)
{
int hlwLen = queHightlightWord.Count;
keywords = new string[hlwLen];
for (int sWordled = 0; sWordled < hlwLen; sWordled++)
{
keywords[sWordled] = (string)queHightlightWord.Dequeue();
}
}
}
else if (mode == 3)
{ //正文匹配
isRelate = AutoClass(contentRule, strSummary, queHightlightWord);
if (isRelate)
{
int hlwLen = queHightlightWord.Count;
keywords = new string[hlwLen];
for (int sWordled = 0; sWordled < hlwLen; sWordled++)
{
keywords[sWordled] = (string)queHightlightWord.Dequeue();
}
}
}
#endregion