line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# This file is part of Pod-Spelling-CommonMistakes |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# This software is copyright (c) 2014 by Apocalypse. |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
# This is free software; you can redistribute it and/or modify it under |
7
|
|
|
|
|
|
|
# the same terms as the Perl 5 programming language system itself. |
8
|
|
|
|
|
|
|
# |
9
|
1
|
|
|
1
|
|
8517
|
use strict; use warnings; |
|
1
|
|
|
1
|
|
1
|
|
|
1
|
|
|
|
|
28
|
|
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
80
|
|
10
|
|
|
|
|
|
|
package Pod::Spelling::CommonMistakes; |
11
|
|
|
|
|
|
|
# git description: 7e441d7 |
12
|
|
|
|
|
|
|
$Pod::Spelling::CommonMistakes::VERSION = '2.001'; |
13
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:APOCAL'; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
# ABSTRACT: Adaptor for Pod::Spelling to use CommonMistakes as a checker |
16
|
|
|
|
|
|
|
|
17
|
1
|
|
|
1
|
|
6
|
use parent 'Pod::Spelling'; # Thanks :) |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
8
|
|
18
|
|
|
|
|
|
|
|
19
|
1
|
|
|
1
|
|
748
|
use Pod::Spell::CommonMistakes::WordList qw( _check_common _check_case ); |
|
1
|
|
|
|
|
2568
|
|
|
1
|
|
|
|
|
94
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
# We override our base... |
22
|
1
|
|
|
1
|
|
5
|
no warnings 'redefine'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
169
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub _init { |
25
|
2
|
50
|
|
2
|
|
923
|
shift if not ref $_[0]; |
26
|
2
|
|
|
|
|
5
|
my $self = shift; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
# Nothing magical to do :) |
29
|
|
|
|
|
|
|
|
30
|
2
|
|
|
|
|
8
|
return $self; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
# Accepts one or more lines of text, returns a list mispelt words. |
34
|
|
|
|
|
|
|
sub _spell_check_callback { |
35
|
20
|
|
|
20
|
|
8433
|
my $self = shift; |
36
|
20
|
|
|
|
|
41
|
my @lines = grep { length $_ } split /\s+/, join( ' ', @_ ); |
|
87
|
|
|
|
|
93
|
|
37
|
20
|
|
|
|
|
42
|
my $err = _check_common( \@lines ); |
38
|
20
|
|
|
|
|
216
|
$err = { %$err, %{ _check_case( \@lines ) } }; |
|
20
|
|
|
|
|
29
|
|
39
|
|
|
|
|
|
|
|
40
|
20
|
|
|
|
|
192
|
return keys %$err; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
1; |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
__END__ |