Get keywords from text/ Find all different worlds within text

This script was created to solve some problems we had when trying to maintain a mailing list.

Latter we have also used this script to


Basics of the script:


 
Getkeywordsfromtext.asp 
<% 
if request.form="" then
Sendform()
else
SendResponse()
end if 
%>

<% sub SendResponse()
Thetext=request.form("Thetext")

if request.form("c1")="1" then
Thetext=Replace(Thetext,"."," ")
end if 
if request.form("c2")="1" then
Thetext=Replace(Thetext,","," ")
end if 
if request.form("c3")="1" then
Thetext=Replace(Thetext,";"," ")
end if 
if request.form("c4")="1" then
Thetext=Replace(Thetext,":"," ")
end if 
if request.form("c5")="1" then
Thetext=Replace(Thetext,"<"," ")
end if 
if request.form("c6")="1" then
Thetext=Replace(Thetext,">"," ")
end if 
if request.form("c7")="1" then
Thetext=Replace(Thetext,CHR(34)," ")
end if 
if request.form("c8")="1" then
Thetext=Replace(Thetext,CHR(39)," ")
end if 
if request.form("c9")="1" then
Thetext=Replace(Thetext,"!"," ")
end if 
if request.form("c10")<>"" then
CharactersArray=Array(request.form("c10"))
MaxCharactersArray=ubound(CharactersArray)
for j=0 to MaxCharactersArray
Thetext=Replace(Thetext,CharactersArray(j)," ")
next
end if
 
 

if request.form("separator")="space" then
Separator=" "
else
Separator=request.form("separator2")
end if

Casesitive=request.form("casesensitive")
Theseparatedworlds=split (Thetext,Separator)
max=ubound(Theseparatedworlds)
Thetext=Separator

for counter=0 to max
  if instr (1,Thetext,Separator &Theseparatedworlds(counter) & Separator,Casesitive)=0 then
   Thetext=Thetext & Theseparatedworlds(counter)  & Separator
 end if
next
Response.write(Thetext)
end sub
%>

<% sub Sendform() %>
<HTML><BODY BGCOLOR=FFFFFF>
<center>
<FORM method=post action=Getkeywordsfromtext.asp>
<table border=0><tr><td>
<TEXTAREA name=theText rows=10 Cols=60></TEXTAREA><br>
<input type=checkbox name=separator value=space checked> Space
<input type=text name=separator2 size=3> Other separator<br>
<input type=radio name=casesensitive value=0> Key sensitive
<input type=radio name=casesensitive value=1 checked> No key sensitive<p>

</td><td valign=top>

<b>Remove especial characters:</b><br>
<input type=radio name=c2 value=1 checked> .<br>
<input type=radio name=c3 value=1 checked> ,<br>
<input type=radio name=c4 value=1 checked> ;<br>
<input type=radio name=c5 value=1 checked> :<br>
<input type=radio name=c6 value=1 checked> <<br>
<input type=radio name=c7 value=1 checked> ><br>
<input type=radio name=c1 value=1 checked> "<br>
<input type=radio name=c8 value=1 checked> '<br>
<input type=radio name=c9 value=1 checked> !<br>
<fonr size=2>Characters of words separated by commas</font>
<input type=text name=c10 size=5><br>

</td></tr></table>

<INPUT type=submit value="Get keywords / Find all different words">
</FORM>
</center>

<div align=right>
Script provided by <a href=http://www.asptutorial.info>AspTutorial.info</a>
</div>

</body></html>
<% end sub %>


 
Examples:

Text:
My friend has a big dog in the yard and he is very agresive. There are two reasons for this behavior: he is alone all the day long and he has never been treated with love. The postman has no problems with the dog. In fact the dog is very happy whenever the postman arrives. the postman is sometimes the only visit during the day. 

Conditions: Separator, space. All especial characters checked. No case sensitive

Output:
My friend has a big dog in the yard and he is very agresive There are two reasons for this behavior alone all day long never been treated with love postman no problems fact happy whenever arrives sometimes only visit during 


AspTutorial.info.