View Single Post
  #12  
Old 01-15-2008, 08:44 AM
Dan Dan is offline
Daniel
Join Date: Oct 2007
Posts: 383
Dan is an unknown quantity at this point
Send a message via MSN to Dan
I guess we should just load those word combinations generated, with some dictionairy script (it's around here somewhere).

*swings magic wand to gather post*

Quote:
Originally Posted by fowlplay4 View Post
Dictionary
Heres my functions , while playing with this script you'll find many funny definitions. LOL

PHP Code:
function Define(word) {
 
temp.link "http://www.onelook.com/?w=" word "&ls=a";
 echo(
"Requesting Definition of" SPC word ":");
 
temp.req requesturl(temp.link);
 
this.catchevent(temp.req,"onReceiveData","onDefine");
}
function 
onDefine(obj) {
 
temp.toks obj.fulldata.tokenize("\n");
 for(
btemp.toks) {
  if (
== "<LI>") continue;
  if (
b.starts("<LI>") > 0) {
   
temp.ntoks b.tokenize(";");
   
temp.npos temp.ntoks[2].pos("(");
   
temp.defin temp.ntoks[2].substring(0,temp.npos);
   if (
temp.defin.length() > 1) echo(" - " temp.defin);
   
temp.msg++;
  }
 }
 if (
temp.msg == 0) echo("No Definitions Found!");

Perhaps change that into returning 'temp.msg > 0'. Could need some better dictionary maybe.
__________________
Reply With Quote