Juste pour afficher la mise à jour de mon correcteur orthographique: J'ai changé l'algorithme "simpliste" du split ' ', par quelque chose d'un peu plus performant.
J'en profite donc pour ajouter les sources du site web en ligne. Vous pouvez donc évidemment retrouver le fichier check.pl là-bas.
my @checkit = ();
my $current_word="";
foreach(split '',$word)
{
my $real = $_;
$real =~ s/\n/<br\/>/g;
if($real =~ /[^\wáàëéèëíìïòóöúùüâêîôu]/i)
{
if ($current_word && $speller->check($current_word))
{
push(@checkit,$current_word);
}
elsif($current_word) { push(@checkit,"<span class=\"bad\">$current_word</span>"); }
$current_word = "";
push(@checkit,$real);
}
else { $current_word .= $real; }
}
if ($current_word && $speller->check($current_word))
{
push(@checkit,$current_word);
}
elsif($current_word) { push(@checkit,"<span class=\"bad\">$current_word</span>"); }
push(@checkit,$real);
my $retour = join("",@checkit);
print $retour;