line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Regexp::Common::lingua; |
2
|
|
|
|
|
|
|
|
3
|
71
|
|
|
71
|
|
597
|
use 5.10.0; |
|
71
|
|
|
|
|
151
|
|
4
|
|
|
|
|
|
|
|
5
|
71
|
|
|
71
|
|
242
|
use strict; |
|
71
|
|
|
|
|
77
|
|
|
71
|
|
|
|
|
1182
|
|
6
|
71
|
|
|
71
|
|
198
|
use warnings; |
|
71
|
|
|
|
|
75
|
|
|
71
|
|
|
|
|
1544
|
|
7
|
71
|
|
|
71
|
|
201
|
no warnings 'syntax'; |
|
71
|
|
|
|
|
76
|
|
|
71
|
|
|
|
|
1995
|
|
8
|
|
|
|
|
|
|
|
9
|
71
|
|
|
71
|
|
225
|
use Regexp::Common qw /pattern clean no_defaults/; |
|
71
|
|
|
|
|
72
|
|
|
71
|
|
|
|
|
360
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '2016060801'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
pattern name => [qw /lingua palindrome -chars=[A-Za-z]/], |
15
|
|
|
|
|
|
|
create => sub { |
16
|
71
|
|
|
71
|
|
275
|
use re 'eval'; |
|
71
|
|
|
|
|
84
|
|
|
71
|
|
|
|
|
9007
|
|
17
|
|
|
|
|
|
|
my $keep = exists $_ [1] -> {-keep}; |
18
|
|
|
|
|
|
|
my $ch = $_ [1] -> {-chars}; |
19
|
|
|
|
|
|
|
my $idx = $keep ? "1:$ch" : "0:$ch"; |
20
|
|
|
|
|
|
|
my $r = "(??{\$Regexp::Common::lingua::pd{'" . $idx . "'}})"; |
21
|
|
|
|
|
|
|
$Regexp::Common::lingua::pd {$idx} = |
22
|
|
|
|
|
|
|
$keep ? qr /($ch|($ch)($r)?\2)/ : qr /$ch|($ch)($r)?\1/; |
23
|
|
|
|
|
|
|
# print "[$ch]: ", $Regexp::Common::lingua::pd {$idx}, "\n"; |
24
|
|
|
|
|
|
|
# $Regexp::Common::lingua::pd {$idx}; |
25
|
|
|
|
|
|
|
}, |
26
|
|
|
|
|
|
|
; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
__END__ |