| 1 | ## -*- Mode: CPerl -*- | ||||||||||||||||||||||||||||||||||
| 2 | ## File: DiaColloDB::Document::DDCTabs.pm | ||||||||||||||||||||||||||||||||||
| 3 | ## Author: Bryan Jurish <moocow@cpan.org> | ||||||||||||||||||||||||||||||||||
| 4 | ## Description: collocation db, source document, DDC tab-dump | ||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||
| 6 | package DiaColloDB::Document::DDCTabs; | ||||||||||||||||||||||||||||||||||
| 7 | 1 | ▶ | use DiaColloDB::Document; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 8 | 1 | ▶ | use IO::File; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 9 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||
| 11 | ##============================================================================== | ||||||||||||||||||||||||||||||||||
| 12 | ## Globals & Constants | ||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||
| 14 | 1 | our @ISA = qw(DiaColloDB::Document); | |||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||
| 16 | ##============================================================================== | ||||||||||||||||||||||||||||||||||
| 17 | ## Constructors etc. | ||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||
| 19 | ## $doc = CLASS_OR_OBJECT->new(%args) | ||||||||||||||||||||||||||||||||||
| 20 | ## + %args, object structure: | ||||||||||||||||||||||||||||||||||
| 21 | ## ( | ||||||||||||||||||||||||||||||||||
| 22 | ## ##-- parsing options | ||||||||||||||||||||||||||||||||||
| 23 | ## eosre => $re, ##-- EOS regex (empty or undef for file-breaks only; default='^$') | ||||||||||||||||||||||||||||||||||
| 24 | ## utf8 => $bool, ##-- enable utf8 parsing? (default=1) | ||||||||||||||||||||||||||||||||||
| 25 | ## trimPND => $bool, ##-- create trimmed "pnd" meta-attribute? (default=1) | ||||||||||||||||||||||||||||||||||
| 26 | ## trimAuthor => $bool, ##-- trim "author" meta-attribute (eliminate DTA PNDs)? (default=1) | ||||||||||||||||||||||||||||||||||
| 27 | ## trimGenre => $bool, ##-- create trimmed "genre" meta-attribute? (default=1) | ||||||||||||||||||||||||||||||||||
| 28 | ## foreign => $bool, ##-- alias for trimAuthor=0 trimPND=0 trimGenre=0 | ||||||||||||||||||||||||||||||||||
| 29 | ## ## | ||||||||||||||||||||||||||||||||||
| 30 | ## ##-- document data | ||||||||||||||||||||||||||||||||||
| 31 | ## date =>$date, ##-- year | ||||||||||||||||||||||||||||||||||
| 32 | ## wf =>$iw, ##-- index-field for $word attribute (default=0) | ||||||||||||||||||||||||||||||||||
| 33 | ## pf =>$ip, ##-- index-field for $pos attribute (default=1) | ||||||||||||||||||||||||||||||||||
| 34 | ## lf =>$il, ##-- index-field for $lemma attribute (default=2) | ||||||||||||||||||||||||||||||||||
| 35 | ## pagef =>$ipage, ##-- index-field for $page attribute (default=undef:none) | ||||||||||||||||||||||||||||||||||
| 36 | ## tokens =>\@tokens, ##-- tokens, including undef for EOS | ||||||||||||||||||||||||||||||||||
| 37 | ## meta =>\%meta, ##-- document metadata (e.g. author, title, collection, ...) | ||||||||||||||||||||||||||||||||||
| 38 | ## ## + may also generate special $meta->{genre} as 1st component of $meta->{textClass} if available | ||||||||||||||||||||||||||||||||||
| 39 | ## ) | ||||||||||||||||||||||||||||||||||
| 40 | ## + each token in @tokens is a HASH-ref {w=>$word,p=>$pos,l=>$lemma,...} | ||||||||||||||||||||||||||||||||||
| 41 | ## + default attribute positions ($iw,$ip,$il,$ipage) are overridden doc lines '%%$DDC:index[INDEX]=LONGNAME w' etc if present | ||||||||||||||||||||||||||||||||||
| 42 | 0 | ▶ | sub new { | ||||||||||||||||||||||||||||||||
|
Subroutine
new: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 43 | 0 | my $that = shift; | |||||||||||||||||||||||||||||||||
| 44 | 0 | my $doc = $that->SUPER::new( | |||||||||||||||||||||||||||||||||
| 45 | utf8=>1, | ||||||||||||||||||||||||||||||||||
| 46 | trimPND=>1, | ||||||||||||||||||||||||||||||||||
| 47 | trimAuthor=>1, | ||||||||||||||||||||||||||||||||||
| 48 | trimGenre=>1, | ||||||||||||||||||||||||||||||||||
| 49 | eosre=>qr{^$}, | ||||||||||||||||||||||||||||||||||
| 50 | wf=>0, | ||||||||||||||||||||||||||||||||||
| 51 | pf=>1, | ||||||||||||||||||||||||||||||||||
| 52 | lf=>2, | ||||||||||||||||||||||||||||||||||
| 53 | pagef=>undef, | ||||||||||||||||||||||||||||||||||
| 54 | @_, ##-- user arguments | ||||||||||||||||||||||||||||||||||
| 55 | ); | ||||||||||||||||||||||||||||||||||
| 56 | 0 | return $doc; | |||||||||||||||||||||||||||||||||
| 57 | } | ||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||
| 59 | ##============================================================================== | ||||||||||||||||||||||||||||||||||
| 60 | ## API: I/O | ||||||||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||||||||
| 62 | ## $ext = $doc->extension() | ||||||||||||||||||||||||||||||||||
| 63 | ## + default extension, for Corpus::Compiled | ||||||||||||||||||||||||||||||||||
| 64 | 0 | ▶ | sub extension { | ||||||||||||||||||||||||||||||||
|
Subroutine
extension: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||
| 65 | 0 | return '.tabs'; | |||||||||||||||||||||||||||||||||
| 66 | } | ||||||||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||||||||
| 68 | ##-------------------------------------------------------------- | ||||||||||||||||||||||||||||||||||
| 69 | ## API: I/O: parse | ||||||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||||
| 71 | ## $bool = $doc->fromFile($filename_or_fh, %opts) | ||||||||||||||||||||||||||||||||||
| 72 | ## + parse tokens from $filename_or_fh | ||||||||||||||||||||||||||||||||||
| 73 | ## + %opts : clobbers %$doc | ||||||||||||||||||||||||||||||||||
| 74 | 0 | ▶ | sub fromFile { | ||||||||||||||||||||||||||||||||
|
Subroutine
fromFile: not called CC=47 SCAR=77.2
Pod
documented
| |||||||||||||||||||||||||||||||||||
| 75 | 0 | my ($doc,$file,%opts) = @_; | |||||||||||||||||||||||||||||||||
| 76 | 0 | ▶ | $doc = $doc->new() if (!ref($doc)); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 77 | 0 | @$doc{keys %opts} = values %opts; | |||||||||||||||||||||||||||||||||
| 78 | 0 | ▶ | $doc->{label} = ref($file) ? "$file" : $file; | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 79 | 0 | ▶ | my $fh = ref($file) ? $file : IO::File->new("<$file"); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 80 | 0 | ▶ | $doc->logconfess("fromFile(): cannot open file '$file': $!") if (!ref($fh)); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 81 | 0 | ▶ | binmode($fh,':utf8') if ($doc->{utf8}); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 82 | |||||||||||||||||||||||||||||||||||
| 83 | 0 | ▶ | my ($wf,$pf,$lf,$pagef) = map {($_//-1)} @$doc{qw(wf pf lf pagef)}; | ||||||||||||||||||||||||||||||||
|
Condition0%0/2
$_ // -1
MC/DC0%0/1
$_ // -1
$_
Truth table0%0/2
A
A= $_
| |||||||||||||||||||||||||||||||||||
| 84 | 0 | my $tokens = $doc->{tokens}; | |||||||||||||||||||||||||||||||||
| 85 | 0 | @$tokens = qw(); | |||||||||||||||||||||||||||||||||
| 86 | 0 | my $meta = $doc->{meta}; | |||||||||||||||||||||||||||||||||
| 87 | 0 | %$meta = qw(); | |||||||||||||||||||||||||||||||||
| 88 | 0 | my $eos = undef; | |||||||||||||||||||||||||||||||||
| 89 | 0 | my $eosre = $doc->{eosre}; | |||||||||||||||||||||||||||||||||
| 90 | 0 | ▶ | $eosre = qr{$eosre} if ($eosre && !ref($eosre)); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$eosre and not ref $eosre
MC/DC0%0/2
$eosre and not ref $eosre
$eosre
not ref $eosre
Truth table0%0/3
A and not(B)
A= $eosreB= not ref $eosre
| |||||||||||||||||||||||||||||||||||
| 91 | 0 | my $last_was_eos = 1; | |||||||||||||||||||||||||||||||||
| 92 | 0 | my $is_eos = 0; | |||||||||||||||||||||||||||||||||
| 93 | 0 | my $curpage = ''; | |||||||||||||||||||||||||||||||||
| 94 | 0 | my ($w,$p,$l,$page); | |||||||||||||||||||||||||||||||||
| 95 | 0 | ▶ | while (defined($_=<$fh>)) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 96 | 0 | chomp; | |||||||||||||||||||||||||||||||||
| 97 | 0 | ▶ | if (/^%%/) { | ||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||
| 98 | 0 | ▶ | if (/^%%(?:\$DDC:meta\.date_|\$?date)=([0-9]+)/) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 99 | 0 | $doc->{date} = $1; | |||||||||||||||||||||||||||||||||
| 100 | } | ||||||||||||||||||||||||||||||||||
| 101 | 0 | ▶ | if (/^%%\$DDC:meta\.([^=]+)=(.*)$/) { | ||||||||||||||||||||||||||||||||
|
Branch: 7 branches
| |||||||||||||||||||||||||||||||||||
| 102 | 0 | $meta->{$1} = $2; | |||||||||||||||||||||||||||||||||
| 103 | } | ||||||||||||||||||||||||||||||||||
| 104 | ▶ | elsif (/^%%\$DDC:index\[([0-9]+)\]=Token\b/ || /^%%\$DDC:index\[([0-9]+)\]=\S+ w$/) { | |||||||||||||||||||||||||||||||||
|
Condition0%0/3
/^%%\$DDC:index\[([0-9]+)\]=Token\b/ or /^%%\$DDC:index\[([0-9]+)\]=\S+ w$/
MC/DC0%0/2
/^%%\$DDC:index\[([0-9]+)\]=Token\b/ or /^%%\$DDC:index\[([0-9]+)\]=\S+ w$/
/^%%\$DDC:index\[([0-9]+)\]=Token\b/
/^%%\$DDC:index\[([0-9]+)\]=\S+ w$/
Truth table0%0/3
A or B
A= /^%%\$DDC:index\[([0-9]+)\]=Token\b/B= /^%%\$DDC:index\[([0-9]+)\]=\S+ w$/
| |||||||||||||||||||||||||||||||||||
| 105 | 0 | $wf = $doc->{wf} = $1; | |||||||||||||||||||||||||||||||||
| 106 | } | ||||||||||||||||||||||||||||||||||
| 107 | ▶ | elsif (/^%%\$DDC:index\[([0-9]+)\]=Pos\b/ || /^%%\$DDC:index\[([0-9]+)\]=\S+ p$/) { | |||||||||||||||||||||||||||||||||
|
Condition0%0/3
/^%%\$DDC:index\[([0-9]+)\]=Pos\b/ or /^%%\$DDC:index\[([0-9]+)\]=\S+ p$/
MC/DC0%0/2
/^%%\$DDC:index\[([0-9]+)\]=Pos\b/ or /^%%\$DDC:index\[([0-9]+)\]=\S+ p$/
/^%%\$DDC:index\[([0-9]+)\]=Pos\b/
/^%%\$DDC:index\[([0-9]+)\]=\S+ p$/
Truth table0%0/3
A or B
A= /^%%\$DDC:index\[([0-9]+)\]=Pos\b/B= /^%%\$DDC:index\[([0-9]+)\]=\S+ p$/
| |||||||||||||||||||||||||||||||||||
| 108 | 0 | $pf = $doc->{pf} = $1; | |||||||||||||||||||||||||||||||||
| 109 | } | ||||||||||||||||||||||||||||||||||
| 110 | ▶ | elsif (/^%%\$DDC:index\[([0-9]+)\]=Lemma\b/ || /^%%\$DDC:index\[([0-9]+)\]=\S+ l$/) { | |||||||||||||||||||||||||||||||||
|
Condition0%0/3
/^%%\$DDC:index\[([0-9]+)\]=Lemma\b/ or /^%%\$DDC:index\[([0-9]+)\]=\S+ l$/
MC/DC0%0/2
/^%%\$DDC:index\[([0-9]+)\]=Lemma\b/ or /^%%\$DDC:index\[([0-9]+)\]=\S+ l$/
/^%%\$DDC:index\[([0-9]+)\]=Lemma\b/
/^%%\$DDC:index\[([0-9]+)\]=\S+ l$/
Truth table0%0/3
A or B
A= /^%%\$DDC:index\[([0-9]+)\]=Lemma\b/B= /^%%\$DDC:index\[([0-9]+)\]=\S+ l$/
| |||||||||||||||||||||||||||||||||||
| 111 | 0 | $lf = $doc->{lf} = $1; | |||||||||||||||||||||||||||||||||
| 112 | } | ||||||||||||||||||||||||||||||||||
| 113 | ▶ | elsif (/^%%\$DDC:index\[([0-9]+)\]=Pos\b/ || /^%%\$DDC:index\[([0-9]+)\]=\S+ page$/) { | |||||||||||||||||||||||||||||||||
|
Condition0%0/3
/^%%\$DDC:index\[([0-9]+)\]=Pos\b/ or /^%%\$DDC:index\[([0-9]+)\]=\S+ page$/
MC/DC0%0/2
/^%%\$DDC:index\[([0-9]+)\]=Pos\b/ or /^%%\$DDC:index\[([0-9]+)\]=\S+ page$/
/^%%\$DDC:index\[([0-9]+)\]=Pos\b/
/^%%\$DDC:index\[([0-9]+)\]=\S+ page$/
Truth table0%0/3
A or B
A= /^%%\$DDC:index\[([0-9]+)\]=Pos\b/B= /^%%\$DDC:index\[([0-9]+)\]=\S+ page$/
| |||||||||||||||||||||||||||||||||||
| 114 | 0 | $pagef = $doc->{pagef} = $1; | |||||||||||||||||||||||||||||||||
| 115 | } | ||||||||||||||||||||||||||||||||||
| 116 | elsif (/^%%\$DDC:BREAK.([^=\[\]]+)/) { | ||||||||||||||||||||||||||||||||||
| 117 | 0 | push(@$tokens,"#$1"); | |||||||||||||||||||||||||||||||||
| 118 | } | ||||||||||||||||||||||||||||||||||
| 119 | elsif (/^%%\$DDC:PAGE=/) { | ||||||||||||||||||||||||||||||||||
| 120 | 0 | push(@$tokens,"#page"); | |||||||||||||||||||||||||||||||||
| 121 | } | ||||||||||||||||||||||||||||||||||
| 122 | 0 | ▶ | if ($eosre && $_ =~ $eosre) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$eosre and $_ =~ /$eosre/
MC/DC0%0/2
$eosre and $_ =~ /$eosre/
$eosre
$_ =~ /$eosre/
Truth table0%0/3
A and B
A= $eosreB= $_ =~ /$eosre/
| |||||||||||||||||||||||||||||||||||
| 123 | 0 | ▶ | push(@$tokens,$eos) if (!$last_was_eos); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 124 | 0 | $last_was_eos = 1; | |||||||||||||||||||||||||||||||||
| 125 | } | ||||||||||||||||||||||||||||||||||
| 126 | 0 | next; | |||||||||||||||||||||||||||||||||
| 127 | } | ||||||||||||||||||||||||||||||||||
| 128 | ▶ | elsif ($eosre && $_ =~ $eosre) { | |||||||||||||||||||||||||||||||||
|
Condition0%0/3
$eosre and $_ =~ /$eosre/
MC/DC0%0/2
$eosre and $_ =~ /$eosre/
$eosre
$_ =~ /$eosre/
Truth table0%0/3
A and B
A= $eosreB= $_ =~ /$eosre/
| |||||||||||||||||||||||||||||||||||
| 129 | 0 | ▶ | push(@$tokens,$eos) if (!$last_was_eos); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 130 | 0 | $last_was_eos = 1; | |||||||||||||||||||||||||||||||||
| 131 | 0 | next; | |||||||||||||||||||||||||||||||||
| 132 | } | ||||||||||||||||||||||||||||||||||
| 133 | 0 | ($w,$p,$l,$page) = (split(/\t/,$_))[$wf,$pf,$lf,$pagef]; | |||||||||||||||||||||||||||||||||
| 134 | |||||||||||||||||||||||||||||||||||
| 135 | ##-- honor dta-style $page index | ||||||||||||||||||||||||||||||||||
| 136 | 0 | ▶ | if ($pagef > 0 && $page ne $curpage) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$pagef > 0 and $page ne $curpage
MC/DC0%0/2
$pagef > 0 and $page ne $curpage
$pagef > 0
$page ne $curpage
Truth table0%0/3
A and B
A= $pagef > 0B= $page ne $curpage
| |||||||||||||||||||||||||||||||||||
| 137 | 0 | push(@$tokens, "#page"); | |||||||||||||||||||||||||||||||||
| 138 | 0 | $curpage = $page; | |||||||||||||||||||||||||||||||||
| 139 | } | ||||||||||||||||||||||||||||||||||
| 140 | |||||||||||||||||||||||||||||||||||
| 141 | ##-- add token | ||||||||||||||||||||||||||||||||||
| 142 | 0 | ▶ | push(@$tokens, {w=>($w//''), p=>($p//''), l=>($l//'')}); | ||||||||||||||||||||||||||||||||
|
Condition0%0/6
$w // ""
$p // ""
$l // ""
MC/DC0%0/1
$w // ""
$w
MC/DC0%0/1
$p // ""
$p
MC/DC0%0/1
$l // ""
$l
Truth table0%0/2
A
A= $w
Truth table0%0/2
A
A= $p
Truth table0%0/2
A
A= $l
| |||||||||||||||||||||||||||||||||||
| 143 | 0 | $last_was_eos = 0; | |||||||||||||||||||||||||||||||||
| 144 | } | ||||||||||||||||||||||||||||||||||
| 145 | 0 | ▶ | push(@$tokens,$eos) if (!$last_was_eos); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 146 | |||||||||||||||||||||||||||||||||||
| 147 | 0 | ▶ | if (!$doc->{foreign}) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 148 | ##-- hack: compute top-level $meta->{genre} from $meta->{textClass} if requested | ||||||||||||||||||||||||||||||||||
| 149 | 0 | ▶ | $meta->{genre} //= $meta->{textClass}; | ||||||||||||||||||||||||||||||||
|
Condition0%0/3
$meta->{"genre"} //= $meta->{"textClass"}
MC/DC0%0/2
$meta->{"genre"} //= $meta->{"textClass"}
$meta->{"genre"}
$meta->{"textClass"}
Truth table0%0/3
A //= B
A= $meta->{"genre"}B= $meta->{"textClass"}
| |||||||||||||||||||||||||||||||||||
| 150 | $meta->{genre} =~ s/\:.*$// | ||||||||||||||||||||||||||||||||||
| 151 | 0 | ▶ | if ($doc->{trimGenre} && defined($meta->{genre})); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$doc->{"trimGenre"} and defined $meta->{"genre"}
MC/DC0%0/2
$doc->{"trimGenre"} and defined $meta->{"genre"}
$doc->{"trimGenre"}
defined $meta->{"genre"}
Truth table0%0/3
A and B
A= $doc->{"trimGenre"}B= defined $meta->{"genre"}
| |||||||||||||||||||||||||||||||||||
| 152 | |||||||||||||||||||||||||||||||||||
| 153 | ##-- hack: compute/trim top-level $meta->{pnd} if requested | ||||||||||||||||||||||||||||||||||
| 154 | 0 | ▶ | $meta->{pnd} //= $meta->{author}; | ||||||||||||||||||||||||||||||||
|
Condition0%0/3
$meta->{"pnd"} //= $meta->{"author"}
MC/DC0%0/2
$meta->{"pnd"} //= $meta->{"author"}
$meta->{"pnd"}
$meta->{"author"}
Truth table0%0/3
A //= B
A= $meta->{"pnd"}B= $meta->{"author"}
| |||||||||||||||||||||||||||||||||||
| 155 | 0 | ▶ | if ($doc->{trimPND} && defined($meta->{pnd})) { | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$doc->{"trimPND"} and defined $meta->{"pnd"}
MC/DC0%0/2
$doc->{"trimPND"} and defined $meta->{"pnd"}
$doc->{"trimPND"}
defined $meta->{"pnd"}
Truth table0%0/3
A and B
A= $doc->{"trimPND"}B= defined $meta->{"pnd"}
| |||||||||||||||||||||||||||||||||||
| 156 | 0 | $meta->{pnd} = join(' ', ($meta->{pnd} =~ m/\#[0-9a-zA-Z]+/g)); | |||||||||||||||||||||||||||||||||
| 157 | 0 | ▶ | delete($meta->{pnd}) if (($meta->{pnd}//'') eq ''); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
$meta->{"pnd"} // ""
MC/DC0%0/1
$meta->{"pnd"} // ""
$meta->{"pnd"}
Truth table0%0/2
A
A= $meta->{"pnd"}
| |||||||||||||||||||||||||||||||||||
| 158 | } | ||||||||||||||||||||||||||||||||||
| 159 | |||||||||||||||||||||||||||||||||||
| 160 | ##-- hack: trim top-level $meta->{author} if requested | ||||||||||||||||||||||||||||||||||
| 161 | $meta->{author} =~ s/\s*\([^\)]*\)$// | ||||||||||||||||||||||||||||||||||
| 162 | 0 | ▶ | if ($doc->{trimAuthor} && defined($meta->{author})); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$doc->{"trimAuthor"} and defined $meta->{"author"}
MC/DC0%0/2
$doc->{"trimAuthor"} and defined $meta->{"author"}
$doc->{"trimAuthor"}
defined $meta->{"author"}
Truth table0%0/3
A and B
A= $doc->{"trimAuthor"}B= defined $meta->{"author"}
| |||||||||||||||||||||||||||||||||||
| 163 | } | ||||||||||||||||||||||||||||||||||
| 164 | |||||||||||||||||||||||||||||||||||
| 165 | 0 | ▶ | $fh->close() if (!ref($file)); | ||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||
| 166 | 0 | return $doc; | |||||||||||||||||||||||||||||||||
| 167 | } | ||||||||||||||||||||||||||||||||||
| 168 | |||||||||||||||||||||||||||||||||||
| 169 | ##============================================================================== | ||||||||||||||||||||||||||||||||||
| 170 | ## Footer | ||||||||||||||||||||||||||||||||||
| 171 | 1 | 1; | |||||||||||||||||||||||||||||||||
| 172 | |||||||||||||||||||||||||||||||||||
| 173 | __END__ | ||||||||||||||||||||||||||||||||||