Beta Shell
v2.0 ยท web2.us.cloudlogin.co
[FM]
[CMD]
[PHP]
[DB]
[INFO]
[SEC]
File Manager
~
/
usr
/
share
/
perl5
/
vendor_perl
/
Spellunker
Upload
6 items
Name
Size
Perms
Modified
Actions
[ .. / .. ]
CLI
-
drwxr-xr-x
2022-02-23 11:31:13
Del
CLI.pm
330 B
-rw-r--r--
2019-09-22 19:36:51
Edit
Del
Pod
-
drwxr-xr-x
2022-02-23 11:31:13
Del
Pod.pm
1.18 KB
-rw-r--r--
2019-09-22 19:36:51
Edit
Del
Editing: Pod.pm
(1.18 KB)
Path: /usr/share/perl5/vendor_perl/Spellunker/Pod.pm
Back
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;