Tfe

Ongi etorri tfe-ren webgunera...

Old stuff/Perl/dhtml/test.pl

(Deskargatu)
#!/usr/bin/perl -w
$|++;
use Text::Aspell;
use locale;
use Unicode::String;




my $word = "école";
$word =~ s/\%([\da-f]{2})/chr(hex($1))/egi;
print "Word: $word\n";
$word = Unicode::String::utf8($word)->latin1;


my $speller = Text::Aspell->new;
$speller->set_option('lang','fr_FR@utf8');
$speller->set_option('sug-mode','fast');

#print join("<br />", $speller->list_dictionaries);


my @checkit = ();

foreach(split ' ',$word)
{
my $real = $_;
s/\W//g;
#print "CHeck: $_ ($real)<br />";
if ($speller->check($_))
{
push(@checkit,$real);
}

else { push(@checkit,"<span class=\"bad\">$real</span>"); }
}
print join(" ",@checkit);




#print "FIN\n";