line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
11
|
|
|
11
|
|
4785
|
use strict; |
|
11
|
|
|
|
|
111
|
|
|
11
|
|
|
|
|
335
|
|
2
|
11
|
|
|
11
|
|
62
|
use warnings; |
|
11
|
|
|
|
|
22
|
|
|
11
|
|
|
|
|
692
|
|
3
|
|
|
|
|
|
|
package Acme::Lingua::EN::Inflect::Modern 0.008; |
4
|
|
|
|
|
|
|
|
5
|
11
|
|
|
11
|
|
4829
|
use parent qw(Exporter); |
|
11
|
|
|
|
|
4061
|
|
|
11
|
|
|
|
|
90
|
|
6
|
|
|
|
|
|
|
# ABSTRACT: modernize Lingua::EN::Inflect rule's |
7
|
|
|
|
|
|
|
|
8
|
11
|
|
|
11
|
|
9712
|
use Lingua::EN::Inflect 1.86 (); |
|
11
|
|
|
|
|
289215
|
|
|
11
|
|
|
|
|
849
|
|
9
|
11
|
|
|
11
|
|
6448
|
use Sub::Override 0.07; |
|
11
|
|
|
|
|
12025
|
|
|
11
|
|
|
|
|
471
|
|
10
|
|
|
|
|
|
|
|
11
|
11
|
|
|
11
|
|
789
|
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
|
|
82
|
no strict 'refs'; |
|
11
|
|
|
|
|
43
|
|
|
11
|
|
|
|
|
1047
|
|
31
|
|
|
|
|
|
|
*{__PACKAGE__ . '::' . $routine} = sub { |
32
|
142
|
|
|
142
|
|
67227
|
my $override = Sub::Override->new( |
33
|
|
|
|
|
|
|
'Lingua::EN::Inflect::_PL_noun' => \&_PL_noun |
34
|
|
|
|
|
|
|
); |
35
|
|
|
|
|
|
|
|
36
|
142
|
|
|
|
|
7372
|
Lingua::EN::Inflect->can($routine)->(@_); |
37
|
|
|
|
|
|
|
}; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
my $original_PL_noun; |
41
|
11
|
|
|
11
|
|
2687
|
BEGIN { $original_PL_noun = \&Lingua::EN::Inflect::_PL_noun; } |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub _PL_noun { |
44
|
124
|
|
|
124
|
|
1776
|
my ($word, $number) = @_; |
45
|
|
|
|
|
|
|
|
46
|
124
|
|
|
|
|
325
|
my $plural = $original_PL_noun->($word, $number); |
47
|
|
|
|
|
|
|
|
48
|
124
|
50
|
|
|
|
57639
|
return $plural if $plural eq 'his'; |
49
|
124
|
50
|
|
|
|
302
|
return $plural if $plural eq 'us'; |
50
|
|
|
|
|
|
|
|
51
|
124
|
100
|
|
|
|
481
|
if ($word =~ /es$/) { |
|
|
100
|
|
|
|
|
|
52
|
5
|
|
|
|
|
38
|
$plural =~ s/e(s$|s\|)/'$1/; |
53
|
|
|
|
|
|
|
} elsif ($word =~ /y$/) { |
54
|
21
|
|
|
|
|
198
|
$plural =~ s/(?:ie|y)?(s$|s\|)/y'$1/; |
55
|
|
|
|
|
|
|
} else { |
56
|
98
|
|
|
|
|
760
|
$plural =~ s/(s$|s\|)/'$1/; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
124
|
|
|
|
|
736
|
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__ |