line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::Perfide::BookCleaner::Aux; |
2
|
1
|
|
|
1
|
|
6
|
use warnings; use strict; |
|
1
|
|
|
1
|
|
2
|
|
|
1
|
|
|
|
|
38
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
3
|
1
|
|
|
1
|
|
474
|
use Biblio::Thesaurus; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
#use Data::Dumper; |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
#our %dicnorm = (); |
7
|
|
|
|
|
|
|
#our @ALONE= (); |
8
|
|
|
|
|
|
|
#our @ALONE_OR_NUMBER= (); |
9
|
|
|
|
|
|
|
#our @NUMBER_RIG= (); |
10
|
|
|
|
|
|
|
#our @NUMERAL=(); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
$INC{'Text/Perfide/BookCleaner/Aux.pm'} =~ m{/Aux\.pm$}; |
13
|
|
|
|
|
|
|
my $the = "$`/capitulos.the"; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub new{ |
16
|
|
|
|
|
|
|
my $proto =shift; |
17
|
|
|
|
|
|
|
my $class = ref($proto) || $proto; |
18
|
|
|
|
|
|
|
my $self = {}; |
19
|
|
|
|
|
|
|
$self->{'dicnorm'} = {}; |
20
|
|
|
|
|
|
|
$self->{'ALONE'} = []; |
21
|
|
|
|
|
|
|
$self->{'ALONE_OR_NUMBER'} = []; |
22
|
|
|
|
|
|
|
$self->{'NUMBER_RIG'} = []; |
23
|
|
|
|
|
|
|
$self->{'NUMERAL'} = []; |
24
|
|
|
|
|
|
|
$self->{'_sect'} = []; |
25
|
|
|
|
|
|
|
bless($self,$class); |
26
|
|
|
|
|
|
|
$self->_load_thesaurus(); |
27
|
|
|
|
|
|
|
return $self; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub dicnorm { my $self = shift; $self->{'dicnorm'} = shift if @_; return $self->{'dicnorm'}; } |
31
|
|
|
|
|
|
|
sub ALONE { my $self = shift; $self->{'ALONE'} = shift if @_; return $self->{'ALONE'}; } |
32
|
|
|
|
|
|
|
sub ALONE_OR_NUMBER { my $self = shift; $self->{'ALONE_OR_NUMBER'} = shift if @_; return $self->{'ALONE_OR_NUMBER'}; } |
33
|
|
|
|
|
|
|
sub NUMBER_RIG { my $self = shift; $self->{'NUMBER_RIG'} = shift if @_; return $self->{'NUMBER_RIG'}; } |
34
|
|
|
|
|
|
|
sub NUMERAL { my $self = shift; $self->{'NUMERAL'} = shift if @_; return $self->{'NUMERAL'}; } |
35
|
|
|
|
|
|
|
sub _sect { my $self = shift; $self->{'_sect'} = shift if @_; return $self->{'_sect'}; } |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub _load_thesaurus{ |
39
|
|
|
|
|
|
|
my $self = shift; |
40
|
|
|
|
|
|
|
my @l=qw{ PT EN ES FR DE IT RU PL}; |
41
|
|
|
|
|
|
|
my %l; @l{@l}=@l; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
my $obj = thesaurusLoad($the); |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
my %handler = ( |
46
|
|
|
|
|
|
|
#-end => sub { $pattfile .= "\n}\n";}, |
47
|
|
|
|
|
|
|
#-eachTerm => sub { "\n______________ $term $_"}, |
48
|
|
|
|
|
|
|
-default => sub { |
49
|
|
|
|
|
|
|
if( $l{$rel}){ |
50
|
|
|
|
|
|
|
for(@terms){ |
51
|
|
|
|
|
|
|
$self->dicnorm->{$_} = $term; |
52
|
|
|
|
|
|
|
if ($obj->hasRelation($term,"BT","_alone")) { push @{$self->ALONE},$_ if active($rel) } |
53
|
|
|
|
|
|
|
elsif($obj->hasRelation($term,"BT","_alone_or_number")) { push @{$self->ALONE_OR_NUMBER},$_ if active($rel) } |
54
|
|
|
|
|
|
|
elsif($obj->hasRelation($term,"BT","_number_rig")) { push @{$self->NUMBER_RIG},$_ if active($rel) } |
55
|
|
|
|
|
|
|
elsif($obj->hasRelation($term,"BT","_numeral")) { push @{$self->NUMERAL},$_ if active($rel) } |
56
|
|
|
|
|
|
|
else { push @{$self->_sect},$_ if active($rel) } |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
else { "$rel ".join(", ",@terms) } |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
); |
62
|
|
|
|
|
|
|
$obj->downtr(\%handler); |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
sub active{ |
66
|
|
|
|
|
|
|
1; |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
1; |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
__END__ |