asp智能臟話過(guò)濾系統(tǒng)v1.0
更新時(shí)間:2024年07月01日 11:49:10 投稿:mdxy-dxy
功能比較不錯(cuò)的臟話過(guò)濾系統(tǒng),就是代碼太長(zhǎng)了,具體算法大家可以自己研究下
ivv=ivv+1
icc=0
zang_data(ivv,0,0)="他|她|它"
icc=icc+1
zang_data(ivv,icc,0)=""
zang_data(ivv,icc,1)=0
'-----------------------------
ivv=ivv+1
icc=0
zang_data(ivv,0,0)="裝"
icc=icc+1
zang_data(ivv,icc,0)=""
zang_data(ivv,icc,1)=0
'-----------------------------
ivv=ivv+1
icc=0
zang_data(ivv,0,0)=""
icc=icc+1
zang_data(ivv,icc,0)="的"
zang_data(ivv,icc,1)=0
'-----------------------------
ivv=ivv+1
icc=0
zang_data(ivv,0,0)=""
icc=icc+1
zang_data(ivv,icc,0)="*"
zang_data(ivv,icc,1)=0
'-----------------------------
ivv=ivv+1
icc=0
zang_data(ivv,0,0)=""
icc=icc+1
zang_data(ivv,icc,0)=""
zang_data(ivv,icc,1)=0
'-----------------------------
ivv=ivv+1
icc=0
zang_data(ivv,0,0)="找死"
icc=icc+1
zang_data(ivv,icc,0)="*"
zang_data(ivv,icc,1)=0
'-----------------------------
ivv=ivv+1
icc=0
zang_data(ivv,0,0)="想死"
icc=icc+1
zang_data(ivv,icc,0)=""
zang_data(ivv,icc,1)=4
'-----------------------------
ivv=ivv+1
icc=0
zang_data(ivv,0,0)="想不想"
icc=icc+1
zang_data(ivv,icc,0)=""
zang_data(ivv,icc,1)=4
'-----------------------------
ivv=ivv+1
icc=0
zang_data(ivv,0,0)="是不是"
icc=icc+1
zang_data(ivv,icc,0)=""
zang_data(ivv,icc,1)=4
'-----------------------------
ivv=ivv+1
icc=0
zang_data(ivv,0,0)=""
icc=icc+1
zang_data(ivv,icc,0)="*"
zang_data(ivv,icc,1)=0
'=====end 臟話數(shù)據(jù)庫(kù)=================================================
sayyssx=lcase(sayyyyx)
'第一層循環(huán)
for zang_lenav=0 to zang_len-1
aassdaks=trim(zang_data(zang_lenav,0,0))
if aassdaks<>"" then
aassdaksa=split(aassdaks,"|")
'第二層循環(huán),針對(duì) "dsf|2343|34234|df"之類(lèi)中的各元素掃描
for aassdxsx=0 to ubound(aassdaksa)
sssaac=lcase(trim(aassdaksa(aassdxsx)))
have_di2cen=1
count_lllppt=0
'針對(duì) 如果 存在重復(fù)的多個(gè)類(lèi)似的臟話,則do while ,直到過(guò)濾完
do while have_di2cen=1
count_lllppt=count_lllppt+1
if count_lllppt>9999 then exit do '防止自循環(huán)
have_di2cen=0
if instr(1,sayyssx,sssaac,1)<>0 then
posfd=instr(1,sayyssx,sssaac,1)
have_di2cen=1
'第三層循環(huán)
for zang_yufa_xiangguan_lenav=1 to zang_yufa_xiangguan_list_max-1
aassdakc=trim(zang_data(zang_lenav,zang_yufa_xiangguan_lenav,0))
aassdakcc=clng(zang_data(zang_lenav,zang_yufa_xiangguan_lenav,1))
need_n2=1
if aassdakc="" and zang_yufa_xiangguan_lenav=1 then
if posfd-1<1 then
sstrt=""
else
sstrt=mid(sayyssx,1,posfd-1)
end if
if posfd+len(sssaac)>len(sayyssx) then
enddt=""
else
enddt=mid(sayyssx,posfd+len(sssaac),len(sayyssx)-(posfd+len(sssaac))+1)
end if
sayyssx=sstrt&thzzzf&enddt
need_n2=0
exit for
end if
if aassdakc<>"" then
aassdakcyy=split(aassdakc,"|")
'第四層循環(huán),針對(duì) "dsf|2343|34234|df"之類(lèi)中的各元素掃描
for aassdakcx=0 to ubound(aassdakcyy)
sssaacc=lcase(trim(aassdakcyy(aassdakcx)))
thzzzf=heihack
'--1--
if sssaacc="" and aassdakcx=0 and zang_yufa_xiangguan_lenav=1 then
if posfd-1<1 then
sstrt=""
else
sstrt=mid(sayyssx,1,posfd-1)
end if
if posfd+len(sssaac)>len(sayyssx) then
enddt=""
else
enddt=mid(sayyssx,posfd+len(sssaac),len(sayyssx)-(posfd+len(sssaac))+1)
end if
sayyssx=sstrt&thzzzf&enddt
need_n2=0
exit for
end if
'--2--
if sssaacc="*" then
if posfd-1<1 then
sstrt=""
else
sstrt=mid(sayyssx,1,posfd-1)
end if
if posfd+len(sssaac)>len(sayyssx) then
enddt=""
else
enddt=mid(sayyssx,posfd+len(sssaac),len(sayyssx)-(posfd+len(sssaac))+1)
end if
sayyssx=sstrt&thzzzf&enddt
need_n2=0
exit for
end if
'--3--
ttrrrue=0
for fdfdfd_scan=1 to aassdakcc+1
ttrrrue=ttrrrue+1
if posfd+len(sssaac)-1++len(sssaacc)+ttrrrue-1>len(sayyssx) then exit for
'以下用于忽略字與字間的空格性的字符,空格性的字符詳見(jiàn)konggexx變量的值
kkkgeee=split(konggexx,"$_kongge_$")
for kkkgeeei=0 to ubound(kkkgeee)
if mid(sayyssx,posfd+len(sssaac)-1+ttrrrue,1)=kkkgeee(kkkgeeei) then
fdfdfd_scan=fdfdfd_scan-1
exit for
end if
next
if mid(sayyssx,posfd+len(sssaac)-1+ttrrrue,len(sssaacc))=sssaacc then
fdzi_pos=posfd+len(sssaac)-1+ttrrrue
if posfd-1<1 then
sstrt=""
else
sstrt=mid(sayyssx,1,posfd-1)
end if
if posfd+len(sssaac)>len(sayyssx) then
enddt=""
else
enddt=mid(sayyssx,posfd+len(sssaac),len(sayyssx)-(posfd+len(sssaac))+1)
end if
sayyssx=sstrt&thzzzf&enddt
new_fdzi_pos=fdzi_pos+(len(thzzzf)-len(sssaac))
if new_fdzi_pos-1<1 then
sstrt=""
else
sstrt=mid(sayyssx,1,new_fdzi_pos-1)
end if
if new_fdzi_pos+len(sssaacc)>len(sayyssx) then
enddt=""
else
enddt=mid(sayyssx,new_fdzi_pos+len(sssaacc),len(sayyssx)-(new_fdzi_pos+len(sssaacc))+1)
end if
sayyssx=sstrt&thzzzf&enddt
need_n2=0
exit for
end if
next
if need_n2=0 then exit for
'執(zhí)行到這,說(shuō)明是 第四層循環(huán)里 dsf|2343|34234|df之類(lèi)中 的上一項(xiàng)未匹配,而繼續(xù)下一項(xiàng),否則已經(jīng)跳
出本循環(huán),這也就是need_n2變量的作用,當(dāng)然也有可能再次進(jìn)入 同一sssaac變量值的 本循環(huán),如果
have_di2cen=1的話
next
end if
'執(zhí)行到這說(shuō)明第四層循環(huán)時(shí) 沒(méi)找到匹配的臟話
if need_n2=0 then exit for
'執(zhí)行到這,說(shuō)明是 第三層循環(huán)里 數(shù)組元素中 的上一項(xiàng)未匹配,而繼續(xù)下一項(xiàng),否則已經(jīng)跳出本循環(huán),這也
就是need_n2變量的作用,當(dāng)然也有可能再次進(jìn)入 同一sssaac變量值的 本循環(huán),如果have_di2cen=1的話
next
if need_n2=1 then '第三層循環(huán) 掃描到末尾,沒(méi)找到匹配的臟話,不用再do while 了
exit do
end if
end if
loop
'第二層循環(huán),針對(duì) "dsf|2343|34234|df"之類(lèi)中的各元素掃描
next
end if
'第一層循環(huán)
next
ND_say_what=sayyssx
end function
'end 智能臟話過(guò)濾系統(tǒng)v1.0
%>
<br>
<br><br>
智能臟話過(guò)濾系統(tǒng)v1.0 ----by 柏拉圖的程序,qq657697290<hr><br>
<form action=a.asp method=post>
<textarea name=aaas cols=50 rows=10><% if request("aaas")="" then%>
2334234234,3434
<%else%>
<%=trim(request("aaas"))%>
<%end if%>
</textarea>
<br>
<input type=submit value="開(kāi)始智能臟話過(guò)濾">
<br><br>
<hr>過(guò)濾后的輸出:<br>
<font color=#ff0000>
<%
response.write ND_say_what(request("aaas"))
%>
</font>
相關(guān)文章
asp 動(dòng)態(tài)數(shù)組 提供Add、Insert、Remove、RemoveAt、Search等方法。
asp動(dòng)態(tài)數(shù)組,提供Add、Insert、Remove、RemoveAt、Search等方法。可以在數(shù)組中存儲(chǔ)對(duì)象不考慮效率問(wèn)題2009-10-10asp之自動(dòng)閉合HTML/ubb標(biāo)簽函數(shù) 附簡(jiǎn)單注釋
在用到編輯器時(shí),就會(huì)碰到一點(diǎn),那就是標(biāo)簽的閉合問(wèn)題,這個(gè)問(wèn)題非常嚴(yán)峻,因?yàn)檫@可能會(huì)導(dǎo)致網(wǎng)頁(yè)顯示的整體樣式受到破壞。2010-04-04asp目錄讀寫(xiě)權(quán)限檢測(cè)腳本 TestFolder
T00LS 檢測(cè)星外可執(zhí)行目錄的一個(gè)工具,今天剛好用到,記錄下。檢測(cè)了下運(yùn)氣差得很,全盤(pán)只能讀不能寫(xiě),檢測(cè)讀寫(xiě)權(quán)限的時(shí)候?qū)⒁韵麓a保存為x.asp上傳到網(wǎng)站修改檢測(cè)目錄,點(diǎn)提交即可2011-11-11不用模板只用ASP+FSO生成靜態(tài)HTML頁(yè)的一個(gè)方法
不用模板只用ASP+FSO生成靜態(tài)HTML頁(yè)的一個(gè)方法...2006-09-09使用ASP實(shí)現(xiàn)網(wǎng)站的“目錄樹(shù)”管理的代碼
使用ASP實(shí)現(xiàn)網(wǎng)站的“目錄樹(shù)”管理的代碼...2007-09-09asp去除html的函數(shù)代碼分析附實(shí)例說(shuō)明
asp去除html的函數(shù)代碼分析附實(shí)例說(shuō)明,經(jīng)腳本之家編程測(cè)試確實(shí)好用。2012-01-01asp(JavaScript)自動(dòng)判斷網(wǎng)頁(yè)編碼并轉(zhuǎn)換的代碼
asp轉(zhuǎn)換網(wǎng)頁(yè)編碼的代碼,用正則匹配頁(yè)面的編碼聲明是gb2312還是別的,然后輸出。2010-06-06