asp智能臟話過濾系統(tǒng)v1.0第2/2頁
更新時間:2024年07月01日 11:49:10 投稿:mdxy-dxy
功能比較不錯的臟話過濾系統(tǒ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ù)庫=================================================
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),針對 "dsf|2343|34234|df"之類中的各元素掃描
for aassdxsx=0 to ubound(aassdaksa)
sssaac=lcase(trim(aassdaksa(aassdxsx)))
have_di2cen=1
count_lllppt=0
'針對 如果 存在重復(fù)的多個類似的臟話,則do while ,直到過濾完
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),針對 "dsf|2343|34234|df"之類中的各元素掃描
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
'以下用于忽略字與字間的空格性的字符,空格性的字符詳見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í)行到這,說明是 第四層循環(huán)里 dsf|2343|34234|df之類中 的上一項未匹配,而繼續(xù)下一項,否則已經(jīng)跳
出本循環(huán),這也就是need_n2變量的作用,當(dāng)然也有可能再次進入 同一sssaac變量值的 本循環(huán),如果
have_di2cen=1的話
next
end if
'執(zhí)行到這說明第四層循環(huán)時 沒找到匹配的臟話
if need_n2=0 then exit for
'執(zhí)行到這,說明是 第三層循環(huán)里 數(shù)組元素中 的上一項未匹配,而繼續(xù)下一項,否則已經(jīng)跳出本循環(huán),這也
就是need_n2變量的作用,當(dāng)然也有可能再次進入 同一sssaac變量值的 本循環(huán),如果have_di2cen=1的話
next
if need_n2=1 then '第三層循環(huán) 掃描到末尾,沒找到匹配的臟話,不用再do while 了
exit do
end if
end if
loop
'第二層循環(huán),針對 "dsf|2343|34234|df"之類中的各元素掃描
next
end if
'第一層循環(huán)
next
ND_say_what=sayyssx
end function
'end 智能臟話過濾系統(tǒng)v1.0
%>
<br>
<br><br>
智能臟話過濾系統(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="開始智能臟話過濾">
<br><br>
<hr>過濾后的輸出:<br>
<font color=#ff0000>
<%
response.write ND_say_what(request("aaas"))
%>
</font>
相關(guān)文章
asp 動態(tài)數(shù)組 提供Add、Insert、Remove、RemoveAt、Search等方法。
asp動態(tài)數(shù)組,提供Add、Insert、Remove、RemoveAt、Search等方法??梢栽跀?shù)組中存儲對象不考慮效率問題2009-10-10asp之自動閉合HTML/ubb標簽函數(shù) 附簡單注釋
在用到編輯器時,就會碰到一點,那就是標簽的閉合問題,這個問題非常嚴峻,因為這可能會導(dǎo)致網(wǎng)頁顯示的整體樣式受到破壞。2010-04-04asp目錄讀寫權(quán)限檢測腳本 TestFolder
T00LS 檢測星外可執(zhí)行目錄的一個工具,今天剛好用到,記錄下。檢測了下運氣差得很,全盤只能讀不能寫,檢測讀寫權(quán)限的時候?qū)⒁韵麓a保存為x.asp上傳到網(wǎng)站修改檢測目錄,點提交即可2011-11-11不用模板只用ASP+FSO生成靜態(tài)HTML頁的一個方法
不用模板只用ASP+FSO生成靜態(tài)HTML頁的一個方法...2006-09-09使用ASP實現(xiàn)網(wǎng)站的“目錄樹”管理的代碼
使用ASP實現(xiàn)網(wǎng)站的“目錄樹”管理的代碼...2007-09-09asp(JavaScript)自動判斷網(wǎng)頁編碼并轉(zhuǎn)換的代碼
asp轉(zhuǎn)換網(wǎng)頁編碼的代碼,用正則匹配頁面的編碼聲明是gb2312還是別的,然后輸出。2010-06-06