| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
11
|
|
|
11
|
|
4322
|
use strict; |
|
|
11
|
|
|
|
|
76
|
|
|
|
11
|
|
|
|
|
295
|
|
|
2
|
11
|
|
|
11
|
|
48
|
use warnings; |
|
|
11
|
|
|
|
|
17
|
|
|
|
11
|
|
|
|
|
718
|
|
|
3
|
|
|
|
|
|
|
package Acme::Lingua::EN::Inflect::Modern 0.007; |
|
4
|
|
|
|
|
|
|
|
|
5
|
11
|
|
|
11
|
|
4761
|
use parent qw(Exporter); |
|
|
11
|
|
|
|
|
3474
|
|
|
|
11
|
|
|
|
|
54
|
|
|
6
|
|
|
|
|
|
|
# ABSTRACT: modernize Lingua::EN::Inflect rule's |
|
7
|
|
|
|
|
|
|
|
|
8
|
11
|
|
|
11
|
|
8188
|
use Lingua::EN::Inflect 1.86 (); |
|
|
11
|
|
|
|
|
235421
|
|
|
|
11
|
|
|
|
|
866
|
|
|
9
|
11
|
|
|
11
|
|
6460
|
use Sub::Override 0.07; |
|
|
11
|
|
|
|
|
10481
|
|
|
|
11
|
|
|
|
|
418
|
|
|
10
|
|
|
|
|
|
|
|
|
11
|
11
|
|
|
11
|
|
674
|
BEGIN { our %EXPORT_TAGS = %Lingua::EN::Inflect::EXPORT_TAGS }; |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
Exporter::export_ok_tags(qw( ALL )); |
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
#pod =head1 SYNOPSIS |
|
16
|
|
|
|
|
|
|
#pod |
|
17
|
|
|
|
|
|
|
#pod Lingua::EN::Inflect is great for converting singular word's to plural's, but |
|
18
|
|
|
|
|
|
|
#pod does not always match modern usage. This module corrects the most common |
|
19
|
|
|
|
|
|
|
#pod case's. |
|
20
|
|
|
|
|
|
|
#pod |
|
21
|
|
|
|
|
|
|
#pod See L for information on using this module, which has an |
|
22
|
|
|
|
|
|
|
#pod identical interface. |
|
23
|
|
|
|
|
|
|
#pod |
|
24
|
|
|
|
|
|
|
#pod =cut |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
my %todo = map { map { $_ => 1 } @$_ } |
|
27
|
|
|
|
|
|
|
values %Lingua::EN::Inflect::EXPORT_TAGS; |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
for my $routine (keys %todo) { |
|
30
|
11
|
|
|
11
|
|
69
|
no strict 'refs'; |
|
|
11
|
|
|
|
|
23
|
|
|
|
11
|
|
|
|
|
853
|
|
|
31
|
|
|
|
|
|
|
*{__PACKAGE__ . '::' . $routine} = sub { |
|
32
|
142
|
|
|
142
|
|
58528
|
my $override = Sub::Override->new( |
|
33
|
|
|
|
|
|
|
'Lingua::EN::Inflect::_PL_noun' => \&_PL_noun |
|
34
|
|
|
|
|
|
|
); |
|
35
|
|
|
|
|
|
|
|
|
36
|
142
|
|
|
|
|
6360
|
Lingua::EN::Inflect->can($routine)->(@_); |
|
37
|
|
|
|
|
|
|
}; |
|
38
|
|
|
|
|
|
|
} |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
my $original_PL_noun; |
|
41
|
11
|
|
|
11
|
|
2267
|
BEGIN { $original_PL_noun = \&Lingua::EN::Inflect::_PL_noun; } |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub _PL_noun { |
|
44
|
124
|
|
|
124
|
|
1467
|
my ($word, $number) = @_; |
|
45
|
|
|
|
|
|
|
|
|
46
|
124
|
|
|
|
|
305
|
my $plural = $original_PL_noun->($word, $number); |
|
47
|
|
|
|
|
|
|
|
|
48
|
124
|
50
|
|
|
|
50834
|
return $plural if $plural eq 'his'; |
|
49
|
124
|
50
|
|
|
|
261
|
return $plural if $plural eq 'us'; |
|
50
|
|
|
|
|
|
|
|
|
51
|
124
|
100
|
|
|
|
396
|
if ($word =~ /es$/) { |
|
|
|
100
|
|
|
|
|
|
|
52
|
5
|
|
|
|
|
31
|
$plural =~ s/e(s$|s\|)/'$1/; |
|
53
|
|
|
|
|
|
|
} elsif ($word =~ /y$/) { |
|
54
|
21
|
|
|
|
|
178
|
$plural =~ s/(?:ie|y)?(s$|s\|)/y'$1/; |
|
55
|
|
|
|
|
|
|
} else { |
|
56
|
98
|
|
|
|
|
650
|
$plural =~ s/(s$|s\|)/'$1/; |
|
57
|
|
|
|
|
|
|
} |
|
58
|
|
|
|
|
|
|
|
|
59
|
124
|
|
|
|
|
626
|
return $plural; |
|
60
|
|
|
|
|
|
|
} |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
#pod =head1 BUG'S |
|
63
|
|
|
|
|
|
|
#pod |
|
64
|
|
|
|
|
|
|
#pod Please report any bug's or feature request's via the GitHub issue tracker at |
|
65
|
|
|
|
|
|
|
#pod L. I will be |
|
66
|
|
|
|
|
|
|
#pod notified, and then you'll automatically be notified of progress on |
|
67
|
|
|
|
|
|
|
#pod your bug as I make change's. |
|
68
|
|
|
|
|
|
|
#pod |
|
69
|
|
|
|
|
|
|
#pod =cut |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
1; |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
__END__ |