#!/usr/bin/perl use CGI qw(param); use CGI qw(:cgi); use IO::File; use LWP::Simple; #use CGI qw(:standard); open (KK, "; close(KK); $rida=0; open (KK, "){ $rida++; } close(KK); open (KK, ">parandatud_tekst.txt"); close(KK); open (KK, ">aruanne_tekst.csv"); print KK "Sona", ";", "Kas oige", "\n"; close(KK); #Ainult lopud korjan ka kokku, et nendega teha sagedustabeleid open (KK, ">lopud_tekst.txt"); close(KK); for ($i1=0; $i1<$rida; $i1++ ){ @uussona1[$i1]=~ s/\n//sg; #print @uussona1[$i1], "\n"; ################################################## Morf analizator if (@uussona1[$i1] ne ""){ #@uussona1[$i1]=~ s/([\x80-\xFF])/chr(0xC0|ord($1)>>6).chr(0x80|ord($1)&0x3F)/eg; $aadress= join("", "http://www.filosoft.ee/html_speller_et/html_spell.cgi?doc=", @uussona1[$i1]); $aadress= join("",$aadress, "&out=T&suggest=yes"); print $aadress, "\n"; #$aadress=~ s/([\x80-\xFF])/chr(0xC0|ord($1)>>6).chr(0x80|ord($1)&0x3F)/eg; print $aadress, "\n"; my $html = get($aadress) or die "Couldn't fetch the Perl Cookbook's page."; $otsitav="FSSuggestCancelLoad()"+'">'; $otsitav2="
"; # print "leidsin" if $html =~ /$otsitav2/; #print $sona; $html =~ m{([\w]+)
}; $sona = $1; print "Aga see ", $sona; #$sales_rank =~ tr[,][]d; # 4,070 becomes 4070 if ($sona ne ""){ $sona="vale"; } else{ $sona="oige"; } #Nyyd kui on leitud algsona, tuleb moodustata fail, kus oleks sona, tema algvorm ja tema lopp open (KK, ">>aruanne_tekst.csv"); print KK @uussona1[$i1], ";", $sona, "\n"; close(KK); } ## suure if lopp } #for tsykli s(skeem) lopp