9 use Pod::Spell::CommonMistakes::WordList qw( _check_case _check_common );
13 find (sub { m/\.U$/ && !-l && -s and push @u, $File::Find::name }, glob "*");
16 "modified/Oldconfig.U" => {
17 "gnu" => "GNU", # output of uname
19 "perl/patchlevel.U" => {
20 "subversion" => "Subversion", # perl's subversion, not svn
23 my %skip = map { m/^(\S+)/; lc $1 => 1 } <DATA>;
24 if (open my $fh, "<", "/pro/3gl/CPAN/perl-git/Porting/Glossary") {
26 m/^(\S+)\s+\(\S+\)\s*:\s*$/ and $skip{lc $1}++;
29 if (open my $fh, "<", "/pro/3gl/CPAN/perl-git/config_h.SH") {
31 m{^/\* ([A-Z_]+):$} and $skip{lc $1}++;
35 my $asp = Text::Aspell->new;
37 foreach my $u (sort @u) {
40 my ($m) = ($u =~ m{([^/]+)\.U$});
46 my $loc = sprintf "%-27s %4d", $u, ++$n;
48 m{^(?| \?RCS: \s+ (\w.*)
55 m{echo \s+ (?| "([^"]+)"
70 $t =~ s{\b[fh]tt?ps?://\S+}{}g; # possible url
71 $t =~ s{<\S+\@\S+>}{}g; # possible e-mail address
72 $t =~ s{<\S+\.h>}{}g; # possibly header file reference
73 $t =~ s{"\S+\.h"}{}g; # possibly header file reference
75 my @w = split m([!-#'-,./:-?[-^`{-~\s]+) => $t;
79 $err = _check_case (\@w);
80 if (ref $err eq "HASH" && keys %$err) {
81 for (sort keys %$err) {
82 exists $ignore{$u}{$_} and next;
83 $seen{$_}++ and next;;
84 printf "%s %-20s => %s\n", $loc, $_, $err->{$_};
88 $err = _check_common (\@w);
89 if (ref $err eq "HASH" && keys %$err) {
90 for (sort keys %$err) {
91 exists $ignore{$u}{$_} and next;
92 $seen{$_}++ and next;;
93 printf "%s %-20s => %s\n", $loc, $_, $err->{$_};
98 for (grep { !m/[-0-9_\$@%~]/ } @w) {
99 exists $ignore{$u}{$_} and next;
100 exists $skip{lc $_} and next;
101 $asp->check ($_) and next;
102 my @s = $asp->suggest ($_);
103 printf "%s %-20s => %s\n", $loc, $_, "(@s)";