Heray-Was-Here
Server : Apache
System : Linux vps103298.mylogin.co 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64
User : calvet ( 273824)
PHP Version : 7.4.33
Disable Function : NONE
Directory :  /proc/thread-self/root/usr/share/perl5/vendor_perl/Spellunker/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/thread-self/root/usr/share/perl5/vendor_perl/Spellunker/Pod.pm
package Spellunker::Pod;
use strict;
use warnings;
use utf8;
use Spellunker;
use Spellunker::Pod::Parser;

sub new {
    my $class = shift;
    bless {spellunker => Spellunker->new()}, $class;
}

sub add_stopwords {
    my $self = shift;
    $self->{spellunker}->add_stopwords(@_);
}

sub load_dictionary {
    my $self = shift;
    $self->{spellunker}->load_dictionary(@_);
}

sub _check_parser {
    my ($self, $parser) = @_;

    # '=for stopwords'
    for my $stopwords (@{$parser->stopwords}) {
        $self->add_stopwords(split /\s+/, $stopwords);
    }

    my $lines = $parser->lines;
    my $line = 0;
    my @rv;
    for my $line ( @$lines ) {
        my $text = $line->[1];
        my @err = $self->{spellunker}->check_line($text);
        if (@err) {
            push @rv, [$line->[0], $line->[1], \@err];
        }
    }
    return @rv;
}

sub check_file {
    my ($self, $filename) = @_;

    my $parser = Spellunker::Pod::Parser->new();
    $parser->parse_file($filename);
    $self->_check_parser($parser);
}

sub check_text {
    my ($self, $text) = @_;

    my $parser = Spellunker::Pod::Parser->new();
    $parser->parse_string_document($text);
    $self->_check_parser($parser);
}

1;


Hry