P. 1
Information Extraction using Fuzzy Logic/code

Information Extraction using Fuzzy Logic/code

|Views: 159|Likes:
Published by Sunil Kumar Reddy
It's an efficient and intelligent search algorithm submitted as mini project for my B.Tech course
It's an efficient and intelligent search algorithm submitted as mini project for my B.Tech course

More info:

Published by: Sunil Kumar Reddy on Jul 24, 2008
Copyright:Traditional Copyright: All rights reserved
List Price: $10.00 Buy Now

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
See more
See less

05/09/2014

$10.00

USD

pdf

text

original

do 'htmltags.

pl'
&html_start("counter");
@documents=<*.txt>;
$=!;
"oreach $document(@documents)
#
open("p$$document);
%hle(&eo"("p))
#
$l=<"p>;
@lne=splt('(s)'$$l);
"oreach $n(@lne)
#
$%ords*$+=$n;
$));
,
,
,
$data*!+="sun";
$c=!;
$-=!;
"or($=!;$<=$.%ords;$)))
#
$-=!;
$re"=$%ords*$+;
"or($/=!;$/<=$.data;$/)))
#
"($re" e0 $data*$/+)
#
$-=1;
,
,
"($-&=1)
#
$data*$c+=$re";
$-=!;
$c));
,
,
"oreach $document(@documents)
#
$=!;
open("p$$document);
%hle(&eo"("p))
#
$l=<"p>;
@lne=splt('(s)'$$l);
"oreach $n(@lne)
#
$%o*$+=$n;
$));
,
,
"oreach $r(@data)
#
$coun=!;
"oreach $x(@%o)
#
"($x e0 $r)
#
$coun));
,
,
$t"re0#$document,#$r,=$coun;
.prnt $t"re0#$document,#$r,;
,
,
"oreach $document(@documents)
#
open("p$$document);
$dl=!;
%hle(&eo"("p))
#
$lne=<"p>;
@%ords=splt('(s)'$$lne);
$dl=$dl)$.%ords)1;
,
$dlength#$document,=$dl;
,
"oreach $%0(@data)
#
$cou=!;
"oreach $n0(@documents)
#
"($t"re0#$n0,#$%0,&=!)
#
$cou));
,
,
$rela2entdocumentsnum#$%0,=$cou;
.prnt $cou;
,
$x34=$.documents)1;
"oreach $%e(@data)
#
"oreach $doc(@documents)
#
$2alue=$x34'$rela2entdocumentsnum#$%e,;
.prnt $2alue;
$x3=$n2ersedoc"re0#$doc,#$%e,=log($2alue)'log(1!);
$document2ector#$doc,#$%e,=$x3*$t"re0#$doc,#$%e,;
.prnt $document2ector#$doc,#$%e,;
.prnt $n2ersedoc"re0#$doc,#$%e,;
.prnt " next";
,
,
"oreach $d(@documents)
#
"oreach $%(@data)
#
$"u443#$d,#$%,=$t"re0#$d,#$%,'$dlength#$d,;
.prnt $"u443#$d,#$%,;
.prnt "next ";
,
,
$ag=$567#"895:;_<=:>6?",;
.prnt $ag;
@para=splt('&'$$ag);
"or($h=!;$h<=$.para;$h)))
#
($pn$$pr)=splt('='$$para*$h+);
$hash#$pn,=$pr;
,
$0uer=$hash#"0uer3",;
.prnt $0uer;
@0uer3=splt('()'$$0uer);
$=!;
"oreach $n(@0uer3)
#
"($n e0 "@:" AA $n e0 "B6C")#,
else
#
$0u*$+=$n;
.prnt $0u*$+;
$));
,
,
"oreach $%s(@0u)
#
"oreach $doc(@documents)
#
"($t"re0#$doc,#$%s,&=69DD)
#
$searched#$doc,#$%s,=$"u443#$doc,#$%s,;
.prnt $searched#$doc,#$%s,;
.prnt "next";
,
else
#
$searched#$doc,#$%s,=!;
,
,
,
"oreach $%s(@0u)
#
$max=!;
"or($=!;$<=$.documents;$)))
#
"($searched#$documents*$+,#$%s,>=$max)
#
$max=$searched#$documents*$+,#$%s,;
$re0d=$documents*$+;
,
,
$retre2ed#$re0d,#$%s,=$max;
prnt "<a hre"=$re0d>$re0d<'a>";
prnt "rela2ance sE";
prnt $retre2ed#$re0d,#$%s,*1!!;
prnt "<h1>"$"(n"$"<'h1>";
.prnt " next";
,
&html_end;

#print $tfreq{$document}{$r}. } $dlength{$document}=$dl.$l).{ $l=<fp>. } foreach $wq(@data) { $cou=0.$line). $dl=$dl+$#words+1. $dl=0. while(!eof(fp)) { $line=<fp>. .$document). } } foreach $document(@documents) { open(fp. } } foreach $r(@data) { $coun=0. foreach $nq(@documents) { if($tfreq{$nq}{$wq}!=0) { $cou++. foreach $n(@line) { $wo[$i]=$n. @line=split(/\s+/. @words=split(/\s+/. $i++. foreach $x(@wo) { if($x eq $r) { $coun++. } } $tfreq{$document}{$r}=$coun.

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->