App-Navegante

 view release on metacpan or  search on metacpan

examples/htgraph  view on Meta::CPAN


=head2 C<$processed>

This variable keeps tracks of the total of processed words in every
request.

=head2 C<$found>

This variable keeps track of the number of found words in the dictionary.

=head2 C<$not_found>

This variable keeps track of the number of found not words in the 
dictionary.

=cut

=head1 FUNCTIONS

=head2 C<htspellDesc>

examples/htspell  view on Meta::CPAN


=head2 C<$processed>

This variable keeps tracks of the total of processed words in every
request.

=head2 C<$found>

This variable keeps track of the number of found words in the dictionary.

=head2 C<$not_found>

This variable keeps track of the number of found not words in the 
dictionary.

=cut

my $processed;
my $found;
my $not_found;

=head1 FUNCTIONS

=head2 C<htspellDesc>

This function prints the description of the application. This
is defined in the DSL by the C<desc> statement.

=cut

examples/htspell  view on Meta::CPAN

        @new = ();
        @words = split(/\s+/, $item);
        foreach (@words) {
            if ($_ =~ m/\w+/) {
                $processed++;
                if ($speller->check($_)) {
                    $found++;
                    push @new, $_;
                }
                else {
                    $not_found++;
                    $estado{$_}++;
                    push @new, "<u>$_</u>";

                }
            }
        }
    }
    return $item;
}

examples/htspell  view on Meta::CPAN

=head2 C<htspellLive>

This is the function that prints the HTML that feeds the banner section
for reporting information. This is defined in the DSL by the
C<livefeedback> statement. Here we print information about the number 
of not found words for every page viewed.

=cut

sub htspellLive {
    my $p = int($not_found/$processed*100);
    my $r = "I checked $processed words, $p% were not found in the dictionary.";
    ($p > 50) and $r .= "<br>Tip: Maybe this page isn't written in english.";
    return $r;
}

=head2 C<htspellInit>

This function runs on the beginig of every request and it's used here
to reset word counters and create an Aspell object for word checking. 
This is defined in the DSL by the C<init> statement.

=cut

sub htspellInit {
    $speller = Text::Aspell->new;
    $speller->set_option('lang','en_US');

    $processed = 0;
    $found = 0;
    $not_found = 0;

}

examples/httag  view on Meta::CPAN


=head2 C<$processed>

This variable keeps tracks of the total of processed words in every
request.

=head2 C<$found>

This variable keeps track of the number of found words in the dictionary.

=head2 C<$not_found>

This variable keeps track of the number of found not words in the 
dictionary.

=cut

=head1 FUNCTIONS

=head2 C<htspellDesc>



( run in 0.244 second using v1.01-cache-2.11-cpan-4d4bc49f3ae )