DiaColloDB/Corpus/Compiled.pm

filter: Statementstmt 15.0% 32 / 213 Branchbran 0.8% 1 / 118 Conditioncond 0.0% 0 / 149 MC/DCmcdc 0.0% 0 / 74 Subroutinesub 35.4% 11 / 31 Podpod 100% 18 / 18 totaltotal 10.2% 62 / 603 CC 115 SCAR 61.9
CC
115
Cov
7%
__ANON__
1482.0
open
342.0
create
240.0
CRAP 485.9
« DiaColloDB/Relation.pm ↑ Summary DiaColloDB/Compat/v0_09/Relation.pm »
1 ## -*- Mode: CPerl -*-
2 ## File: DiaColloDB::Corpus::Compiled.pm
3 ## Author: Bryan Jurish <moocow@cpan.org>
4 ## Description: collocation db, source corpus (pre-compiled)
5  
6 package DiaColloDB::Corpus::Compiled;
7  
8 1 ▶use DiaColloDB::threads;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use DiaColloDB::threads::shared;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 our ($HAVE_THREADS);
11 1 ▶BEGIN {
Subroutine BEGIN: called CC=2 SCAR=7.6
12 1 ▶ $HAVE_THREADS = $DiaColloDB::threads::shared::MODULE ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
$DiaColloDB::threads::shared::MODULE ? : 1 0 1
13 }
14  
15 1 ▶use DiaColloDB::Corpus;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 1 ▶use DiaColloDB::Corpus::Filters;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 1 ▶use DiaColloDB::Logger;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 1 ▶use DiaColloDB::Utils qw(:fcntl :jobs);
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1 ▶use File::Basename qw(basename dirname);
Subroutine BEGIN: called CC=1 SCAR=0.0
20 1 ▶use File::Path qw(make_path remove_tree);
Subroutine BEGIN: called CC=1 SCAR=0.0
21 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 ##==============================================================================
24 ## Globals & Constants
25  
26 1 our @ISA = qw(DiaColloDB::Persistent DiaColloDB::Corpus);
27  
28 ##==============================================================================
29 ## Constructors etc.
30  
31 ## $corpus = CLASS_OR_OBJECT->new(%args)
32 ## + %args, object structure:
33 ## (
34 ## ##-- NEW in DiaColloDB::Corpus::Compiled
35 ## dbdir => $dbdir, ##-- data directory for compiled corpus
36 ## flags => $flags, ##-- open mode flags (fcntl flags or perl-style; default='r')
37 ## filters => \%filters, ##-- corpus filters ( DiaColloDB::Corpus::Filters object or HASH-ref )
38 ## njobs => $njobs, ##-- number of parallel worker jobs for create(); default=-1 (= nCores)
39 ## temp => $bool, ##-- implicitly unlink() on exit?
40 ## logThreads => $level ##-- log-level for thread stuff (default='off')
41 ## ##
42 ## ##-- INHERITED from DiaColloDB::Corpus
43 ## #files => \@files, ##-- source files (OVERRIDE: unused)
44 ## #dclass => $dclass, ##-- DiaColloDB::Document subclass for loading (OVERRIDE force 'DiaColloDB::Document::JSON')
45 ## dopts => \%opts, ##-- options for $dclass->fromFile() (override default={})
46 ## cur => $i, ##-- index of current file
47 ## logOpen => $level, ##-- log-level for open(); default='info'
48 ## )
49 0 ▶sub new {
Subroutine new: not called CC=3 SCAR=24.8
Pod documented
50 0 my $that = shift;
51 0 my $corpus = $that->SUPER::new(
52 ##-- new
53 dbdir => undef,
54 flags => 'r',
55 #filters => DiaColloDB::Corpus::Filters->new(),
56 #temp => 0,
57 #opened => 0,
58 njobs => -1,
59 logThreads => 'off',
60  
61 @_, ##-- user arguments
62  
63 ##-- strong overrides
64 dclass => 'DiaColloDB::Document::JSON',
65 );
66 0 ▶ $corpus->{filters} = DiaColloDB::Corpus::Filters->new() if (!exists($corpus->{filters}));
Branch: 1 branch
BranchTrueFalseTotal
unless exists $corpus->{"filters"} 0 0 0
67 0 ▶ return $corpus->open() if (defined($corpus->{dbdir}));
Branch: 1 branch
BranchTrueFalseTotal
if defined $corpus->{"dbdir"} 0 0 0
68 0 return $corpus;
69 }
70  
71 0 ▶sub DESTROY {
Subroutine DESTROY: not called CC=3 SCAR=24.8
72 0 my $obj = $_[0];
73 0 ▶ $obj->unlink() if ($obj->{temp});
Branch: 1 branch
BranchTrueFalseTotal
if $obj->{"temp"} 0 0 0
74 0 ▶ $obj->close() if ($obj->opened);
Branch: 1 branch
BranchTrueFalseTotal
if $obj->opened 0 0 0
75 }
76  
77 ##==============================================================================
78 ## Persistent API
79  
80 ## @keys = $obj->headerKeys()
81 ## + keys to save as header; default implementation returns all keys of all non-references
82 0 ▶sub headerKeys {
Subroutine headerKeys: not called CC=1 SCAR=6.9
Pod documented
83 0 return (grep {$_ !~ m{^log|^(?:cur|dbdir|njobs|opened|flags|files|list|glob|compiled|append|temp)$}} keys %{$_[0]});
84 }
85  
86 ## @files = $obj->diskFiles()
87 ## + returns disk storage files, used by du() and timestamp()
88 ## + default implementation returns $obj->{file} or glob("$obj->{base}*")
89 0 ▶sub diskFiles {
Subroutine diskFiles: not called CC=2 SCAR=17.9
Pod documented
90 0 my $obj = shift;
91 0 ▶ return ($obj->{dbdir}) if ($obj->{dbdir});
Branch: 1 branch
BranchTrueFalseTotal
if $obj->{"dbdir"} 0 0 0
92 0 return qw();
93 }
94  
95 ## $bool = $obj->unlink(%opts)
96 ## + override %opts:
97 ## close => $bool, ##-- implicitly call $obj->close() ? (default=1)
98 ## + unlinks disk files
99 ## + implcitly calls $obj->close() if available
100 0 ▶sub unlink {
Subroutine unlink: not called CC=4 SCAR=30.0
Pod documented
101 0 my ($obj,%opts) = @_;
102 0 my $dbdir = $obj->datadir;
103 #$obj->vlog($obj->{logOpen}, "unlink(", $obj->dbdir, ")") if ($obj->opened);
104 0 ▶ $obj->close() if (!exists($opts{close}) || $opts{close});
Branch: 1 branch
BranchTrueFalseTotal
if not exists $opts{"close"} or $opts{"close"} 0 0 0
Condition0%0/3
not exists $opts{"close"} or $opts{"close"}
l!l&&r!l&&!r
000
MC/DC0%0/2
not exists $opts{"close"} or $opts{"close"}
not exists $opts{"close"} $opts{"close"}
Truth table0%0/3
not(A) or B
A= not exists $opts{"close"}B= $opts{"close"}
ABresult
1X1
011
000
105 0 ▶ return (-e $dbdir ? File::Path::remove_tree($dbdir) : 1);
Branch: 1 branch
BranchTrueFalseTotal
-e $dbdir ? : 0 0 0
106 }
107  
108 ##----------------------------------------------------------------------
109 ## Compiled API: disk files etc.
110  
111 ## $dirname = $corpus->datadir()
112 ## $dirname = $corpus->datadir($dir)
113 1 ▶BEGIN { *dbdir = \&datadir; }
Subroutine BEGIN: called CC=1 SCAR=0.0
114 0 ▶sub datadir {
Subroutine datadir: not called CC=3 SCAR=24.8
Pod documented
115 0 ▶ my $dir = $_[1] // $_[0]{dbdir};
Condition0%0/3
$_[1] // $_[0]{"dbdir"}
l!l&&r!l&&!r
000
MC/DC0%0/2
$_[1] // $_[0]{"dbdir"}
$_[1] $_[0]{"dbdir"}
Truth table0%0/3
A // B
A= $_[1]B= $_[0]{"dbdir"}
ABresult
1X1
011
000
116 0 ▶ $dir =~ s{/$}{} if ($dir);
Branch: 1 branch
BranchTrueFalseTotal
if $dir 0 0 0
117 0 return $dir;
118 }
119  
120 ## $bool = $corpus->truncate()
121 ## + removes all disk data (including header) and resets $corpus->{size}=0
122 0 ▶sub truncate {
Subroutine truncate: not called CC=2 SCAR=17.9
Pod documented
123 0 my $corpus = shift;
124 0 ▶ return undef if (!$corpus->unlink(close=>0));
Branch: 1 branch
BranchTrueFalseTotal
unless $corpus->unlink("close", 0) 0 0 0
125 0 $corpus->{size} = 0;
126 0 return $corpus;
127 }
128  
129 ## $filters = $ccorpus->filters()
130 ## + return corpus filters as a DiaColloDB::Corpus::Filters object
131 0 ▶sub filters {
Subroutine filters: not called CC=3 SCAR=24.8
Pod documented
132 0 ▶ return $_[0]{filters} if (UNIVERSAL::isa($_[0]{filters},'DiaColloDB::Corpus::Filters'));
Branch: 1 branch
BranchTrueFalseTotal
if UNIVERSAL::isa($_[0]{"filters"}, "DiaColloDB::Corpus::Filters") 0 0 0
133 0 ▶ return DiaColloDB::Corpus::Filters->null() if (!defined($_[0]{filters}));
Branch: 1 branch
BranchTrueFalseTotal
unless defined $_[0]{"filters"} 0 0 0
134 0 return DiaColloDB::Corpus::Filters->new( %{$_[0]{filters}} );
135 }
136  
137 ##==============================================================================
138 ## Corpus API: open/close
139  
140 ## $bool = $corpus->open([$dbdir], %opts); ##-- compat
141 ## $bool = $corpus->open($dbdir, %opts); ##-- new
142 ## + opens corpus "$base.*"
143 ## + \@ARGV should be a single-element $dbdir, or (dbdir=>$dbdir) must exist or be specified in %opts
144 ## + DiaColloDB::Corpus %opts:
145 ## compiled => $bool, ##-- implicit
146 ## glob => $bool, ##-- (ignored) whether to glob arguments
147 ## list => $bool, ##-- (ignored) whether arguments are file-lists
148 0 ▶sub open {
Subroutine open: not called CC=18 SCAR=58.3
Pod documented
149 0 my ($corpus,$argv,%opts) = @_;
150 0 delete @opts{qw(compiled glob list)};
151 0 ▶ $corpus = $corpus->new() if (!ref($corpus));
Branch: 1 branch
BranchTrueFalseTotal
unless ref $corpus 0 0 0
152 0 ▶ $corpus->close() if ($corpus->opened);
Branch: 1 branch
BranchTrueFalseTotal
if $corpus->opened 0 0 0
153 0 @$corpus{keys %opts} = values(%opts);
154  
155 ##-- sanity check(s): dbdir
156 0 my $dbdir = $corpus->dbdir;
157 0 ▶ if (UNIVERSAL::isa($argv,'ARRAY')) {
Branch: 2 branches
BranchTrueFalseTotal
if (UNIVERSAL::isa($argv, 'ARRAY')) { } 0 0 0
elsif (defined $argv) { } 0 0 0
158 0 ▶ if (@$argv==1) {
Branch: 1 branch
BranchTrueFalseTotal
if (@$argv == 1) { } 0 0 0
159 0 $dbdir = $argv->[0]; ##-- single-element list
160 } else {
161 0 $corpus->logconfess("open(): can't handle multi-element array");
162 }
163 } elsif (defined($argv)) {
164 0 $dbdir = $argv; ##-- simple scalar
165 }
166 0 ▶ $corpus->{dbdir} = $corpus->dbdir($dbdir)
Branch: 1 branch
BranchTrueFalseTotal
$corpus->{"dbdir"} = $corpus->dbdir($dbdir) or $corpus->logconfess("open(): no {dbdir} specified!") 0 0 0
167 or $corpus->logconfess("open(): no {dbdir} specified!");
168  
169 0 ▶ my $flags = $corpus->{flags} = (fcflags($corpus->{flags}) | ($corpus->{append} ? fcflags('>>') : 0));
Branch: 1 branch
BranchTrueFalseTotal
$corpus->{'append'} ? : 0 0 0
170 0 $corpus->vlog($corpus->{logOpen}, "open(", fcperl($flags), "$dbdir)");
171  
172 ##-- flag-dependent dispatch
173 0 ▶ if (fcwrite($flags) && fctrunc($flags)) {
Branch: 1 branch
BranchTrueFalseTotal
if (fcwrite($flags) and fctrunc($flags)) 0 0 0
Condition0%0/3
fcwrite($flags) and fctrunc($flags)
!ll&&!rl&&r
000
MC/DC0%0/2
fcwrite($flags) and fctrunc($flags)
fcwrite($flags) fctrunc($flags)
Truth table0%0/3
A and B
A= fcwrite($flags)B= fctrunc($flags)
ABresult
0X0
100
111
174 ##-- truncate: remove any stale corpus
175 0 ▶ $corpus->truncate()
Branch: 1 branch
BranchTrueFalseTotal
$corpus->truncate or $corpus->logconfess(qq[open(): failed to truncate stale corpus $corpus->{"dbdir"}/: $!]) 0 0 0
176 or $corpus->logconfess("open(): failed to truncate stale corpus $corpus->{dbdir}/: $!");
177 }
178 0 ▶ if (fcwrite($flags) && fccreat($flags)) {
Branch: 1 branch
BranchTrueFalseTotal
if (fcwrite($flags) and fccreat($flags)) 0 0 0
Condition0%0/3
fcwrite($flags) and fccreat($flags)
!ll&&!rl&&r
000
MC/DC0%0/2
fcwrite($flags) and fccreat($flags)
fcwrite($flags) fccreat($flags)
Truth table0%0/3
A and B
A= fcwrite($flags)B= fccreat($flags)
ABresult
0X0
100
111
179 ##-- create: data-directory
180 0 my $datadir = $corpus->datadir;
181 0 ▶ -d $datadir
Branch: 1 branch
BranchTrueFalseTotal
-d $datadir or make_path($datadir) or $corpus->logconfess("open(): could not create data directory '${datadir}': $!") 0 0 0
Condition0%0/3
-d $datadir or make_path($datadir)
l!l&&r!l&&!r
000
MC/DC0%0/2
-d $datadir or make_path($datadir)
-d $datadir make_path($datadir)
Truth table0%0/3
A or B
A= -d $datadirB= make_path($datadir)
ABresult
1X1
011
000
182 or make_path($datadir)
183 or $corpus->logconfess("open(): could not create data directory '$datadir': $!");
184 }
185 0 ▶ if (fcread($flags) && !fctrunc($flags)) {
Branch: 1 branch
BranchTrueFalseTotal
if (fcread($flags) and not fctrunc($flags)) 0 0 0
Condition0%0/3
fcread($flags) and not fctrunc($flags)
!ll&&!rl&&r
000
MC/DC0%0/2
fcread($flags) and not fctrunc($flags)
fcread($flags) not fctrunc($flags)
Truth table0%0/3
A and not(B)
A= fcread($flags)B= not fctrunc($flags)
ABresult
0X0
100
111
186 ##-- read-only, no create
187 0 ▶ $corpus->loadHeaderFile
Branch: 1 branch
BranchTrueFalseTotal
$corpus->loadHeaderFile or $corpus->logconfess("open(): failed to load header-file ", $corpus->headerFile) 0 0 0
188 or $corpus->logconfess("open(): failed to load header-file ", $corpus->headerFile);
189 }
190  
191 ##-- force options: dclass, files, opened
192 0 $corpus->{opened} = 1;
193 0 $corpus->{dclass} = 'DiaColloDB::Document::JSON';
194 0 delete $corpus->{files};
195  
196 0 return $corpus;
197 }
198  
199 ## $bool = $corpus->close()
200 0 ▶sub close {
Subroutine close: not called CC=6 SCAR=37.4
Pod documented
201 0 my $corpus = shift;
202 0 ▶ $corpus->vlog($corpus->{logOpen}, "close(", $corpus->dbdir, ")") if ($corpus->opened);
Branch: 1 branch
BranchTrueFalseTotal
if $corpus->opened 0 0 0
203 0 ▶ my $rc = ($corpus->opened && fcwrite($corpus->{flags}) ? $corpus->flush : 1);
Branch: 1 branch
BranchTrueFalseTotal
$corpus->opened && fcwrite($corpus->{'flags'}) ? : 0 0 0
Condition0%0/3
$corpus->opened and fcwrite($corpus->{"flags"})
!ll&&!rl&&r
000
MC/DC0%0/2
$corpus->opened and fcwrite($corpus->{"flags"})
$corpus->opened fcwrite($corpus->{"flags"})
Truth table0%0/3
A and B
A= $corpus->openedB= fcwrite($corpus->{"flags"})
ABresult
0X0
100
111
204 0 ▶ $rc &&= $corpus->SUPER::close();
Condition0%0/3
$rc &&= $corpus->SUPER::close
!ll&&!rl&&r
000
MC/DC0%0/2
$rc &&= $corpus->SUPER::close
$rc $corpus->SUPER::close
Truth table0%0/3
A &&= B
A= $rcB= $corpus->SUPER::close
ABresult
0X0
100
111
205 0 ▶ if ($rc) {
Branch: 1 branch
BranchTrueFalseTotal
if ($rc) 0 0 0
206 0 $corpus->{opened} = 0;
207 0 $corpus->{size} = 0;
208 }
209 0 return $rc;
210 }
211  
212 ##----------------------------------------------------------------------
213 ## Compiled API: open/close
214  
215 ## $bool = $corpus->opened()
216 ## + Returns true iff $corpus is currently opened.
217 0 ▶sub opened {
Subroutine opened: not called CC=2 SCAR=17.9
Pod documented
218 0 my $corpus = shift;
219 0 ▶ return $corpus->{dbdir} && $corpus->{opened};
Condition0%0/3
$corpus->{'dbdir'} && $corpus->{'opened'}
!ll&&!rl&&r
000
MC/DC0%0/2
$corpus->{'dbdir'} && $corpus->{'opened'}
$corpus->{'dbdir'} $corpus->{'opened'}
Truth table0%0/3
A && B
A= $corpus->{'dbdir'}B= $corpus->{'opened'}
ABresult
0X0
100
111
220 }
221  
222 ## $bool = $corpus->flush()
223 ## + flush pending data (header) to disk
224 0 ▶sub flush {
Subroutine flush: not called CC=4 SCAR=30.0
Pod documented
225 0 my $corpus = shift;
226 0 ▶ return undef if (!$corpus->opened || !fcwrite($corpus->{flags}));
Branch: 1 branch
BranchTrueFalseTotal
unless $corpus->opened and fcwrite($corpus->{"flags"}) 0 0 0
Condition0%0/3
$corpus->opened and fcwrite($corpus->{"flags"})
!ll&&!rl&&r
000
MC/DC0%0/2
$corpus->opened and fcwrite($corpus->{"flags"})
$corpus->opened fcwrite($corpus->{"flags"})
Truth table0%0/3
A and B
A= $corpus->openedB= fcwrite($corpus->{"flags"})
ABresult
0X0
100
111
227 0 ▶ $corpus->saveHeader()
Branch: 1 branch
BranchTrueFalseTotal
$corpus->saveHeader or $corpus->logconfess("flush(): failed to store header file ", $corpus->headerFile, ": $!") 0 0 0
228 or $corpus->logconfess("flush(): failed to store header file ", $corpus->headerFile, ": $!");
229 }
230  
231 ## $corpus = $corpus->reopen(%opts)
232 ## + close and re-open corpus (e.g. with different flags)
233 0 ▶sub reopen {
Subroutine reopen: not called CC=3 SCAR=24.8
Pod documented
234 0 my $corpus = shift;
235 0 my $dbdir = $corpus->{dbdir};
236 0 ▶ return $corpus if (!$corpus->opened);
Branch: 1 branch
BranchTrueFalseTotal
unless $corpus->opened 0 0 0
237 0 ▶ return $corpus->close() && $corpus->open([$dbdir], @_);
Condition0%0/3
$corpus->close && $corpus->open([$dbdir], @_)
!ll&&!rl&&r
000
MC/DC0%0/2
$corpus->close && $corpus->open([$dbdir], @_)
$corpus->close $corpus->open([$dbdir], @_)
Truth table0%0/3
A && B
A= $corpus->closeB= $corpus->open([$dbdir], @_)
ABresult
0X0
100
111
238 }
239  
240 ##==============================================================================
241 ## Corpus API: iteration
242 ## + mostly inherited from DiaColloDB::Corpus
243  
244 ## $nfiles = $corpus->size()
245 0 ▶sub size {
Subroutine size: not called CC=2 SCAR=17.9
Pod documented
246 0 ▶ return $_[0]{size} // 0;
Condition0%0/2
$_[0]{"size"} // 0
l!l
00
MC/DC0%0/1
$_[0]{"size"} // 0
$_[0]{"size"}
Truth table0%0/2
A
A= $_[0]{"size"}
Aresult
11
00
247 }
248  
249 ## $bool = $corpus->iok()
250 ## + true if iterator is valid
251 0 ▶sub iok {
Subroutine iok: not called CC=2 SCAR=17.9
Pod documented
252 0 ▶ return $_[0]{cur} < ($_[0]{size}//0);
Condition0%0/2
$_[0]{"size"} // 0
l!l
00
MC/DC0%0/1
$_[0]{"size"} // 0
$_[0]{"size"}
Truth table0%0/2
A
A= $_[0]{"size"}
Aresult
11
00
253 }
254  
255 ## $label = $corpus->ifile()
256 ## $label = $corpus->ifile($pos)
257 ## + current iterator label
258 0 ▶sub ifile {
Subroutine ifile: not called CC=3 SCAR=24.8
Pod documented
259 0 ▶ my $pos = $_[1] // $_[0]{cur};
Condition0%0/3
$_[1] // $_[0]{"cur"}
l!l&&r!l&&!r
000
MC/DC0%0/2
$_[1] // $_[0]{"cur"}
$_[1] $_[0]{"cur"}
Truth table0%0/3
A // B
A= $_[1]B= $_[0]{"cur"}
ABresult
1X1
011
000
260 0 ▶ return undef if ($pos >= $_[0]{size});
Branch: 1 branch
BranchTrueFalseTotal
if $pos >= $_[0]{"size"} 0 0 0
261 0 return "$_[0]{dbdir}/$pos.json";
262 }
263  
264 ## $doc_or_undef = $corpus->idocument()
265 ## $doc_or_undef = $corpus->idocument($pos)
266 ## + gets current document
267 0 ▶sub idocument {
Subroutine idocument: not called CC=4 SCAR=30.0
Pod documented
268 0 my ($corpus,$pos) = @_;
269 0 ▶ $pos //= $corpus->{cur};
Condition0%0/3
$pos //= $corpus->{"cur"}
l!l&&r!l&&!r
000
MC/DC0%0/2
$pos //= $corpus->{"cur"}
$pos $corpus->{"cur"}
Truth table0%0/3
A //= B
A= $posB= $corpus->{"cur"}
ABresult
1X1
011
000
270 0 ▶ return undef if ($pos >= $corpus->size);
Branch: 1 branch
BranchTrueFalseTotal
if $pos >= $corpus->size 0 0 0
271 0 ▶ return $corpus->{dclass}->fromFile($corpus->ifile($pos), %{$corpus->{dopts}//{}});
Condition0%0/2
$corpus->{"dopts"} // {}
l!l
00
MC/DC0%0/1
$corpus->{"dopts"} // {}
$corpus->{"dopts"}
Truth table0%0/2
A
A= $corpus->{"dopts"}
Aresult
11
00
272 }
273  
274  
275 ##==============================================================================
276 ## Corpus::Compiled API: corpus compilation
277  
278 ## $ccorpus = CLASS_OR_OBJECT->create($src_corpus, %opts)
279 ## + compile or append a single $src_corpus to $opts{dbdir}, returns $ccorpus
280 ## + honors $opts{flags} for append and truncate
281 0 ▶sub create {
Subroutine create: not called CC=15 SCAR=54.8
Pod documented
282 0 my ($that,$icorpus,%opts) = @_;
283 0 ▶ my $ocorpus = ref($that) ? $that : $that->new();
Branch: 1 branch
BranchTrueFalseTotal
ref $that ? : 0 0 0
284 0 my $logas = 'create()';
285 0 $ocorpus->vlog('info',$logas);
286  
287 ##-- save options
288 my $odir = $ocorpus->dbdir($opts{dbdir})
289 0 ▶ or $ocorpus->logconfess("$logas: no output corpus {dbdir} specified");
Branch: 1 branch
BranchTrueFalseTotal
my $odir = $ocorpus->dbdir($opts{"dbdir"}) or $ocorpus->logconfess("${logas}: no output corpus {dbdir} specified") 0 0 0
290  
291 0 ▶ my $flags = (fcflags($ocorpus->{flags}) | fcflags($opts{flags})) || fcflags('w');
Condition0%0/3
fcflags($ocorpus->{'flags'}) | fcflags($opts{'flags'}) || fcflags('w')
l!l&&r!l&&!r
000
MC/DC0%0/2
fcflags($ocorpus->{'flags'}) | fcflags($opts{'flags'}) || fcflags('w')
fcflags($ocorpus->{'flags'}) | fcflags($opts{'flags'}) fcflags('w')
Truth table0%0/3
A || B
A= fcflags($ocorpus->{'flags'}) | fcflags($opts{'flags'})B= fcflags('w')
ABresult
1X1
011
000
292 0 delete $opts{dbdir};
293  
294 ##-- (re-)open output corpus
295 0 ▶ if (!$ocorpus->opened || ($ocorpus->{dbdir} ne $odir)) {
Branch: 1 branch
BranchTrueFalseTotal
if (not $ocorpus->opened or $ocorpus->{"dbdir"} ne $odir) 0 0 0
Condition0%0/3
not $ocorpus->opened or $ocorpus->{"dbdir"} ne $odir
l!l&&r!l&&!r
000
MC/DC0%0/2
not $ocorpus->opened or $ocorpus->{"dbdir"} ne $odir
not $ocorpus->opened $ocorpus->{"dbdir"} ne $odir
Truth table0%0/3
not(A) or B
A= not $ocorpus->openedB= $ocorpus->{"dbdir"} ne $odir
ABresult
1X1
011
000
296 0 ▶ $ocorpus->open([$odir], %opts, flags=>$flags)
Branch: 1 branch
BranchTrueFalseTotal
$ocorpus->open([$odir], %opts, "flags", $flags) or $ocorpus->logconfess("${logas}: failed to (re-)open output corpus '${odir}' in mode '", fcperl($flags)) 0 0 0
297 or $ocorpus->logconfess("$logas: failed to (re-)open output corpus '$odir' in mode '", fcperl($flags));
298 }
299 0 @$ocorpus{keys %opts} = values %opts;
300  
301 ##-- check whether we're doing any filtering at all
302 0 my $filters = $ocorpus->filters();
303 0 my $dofilter = !$filters->isnull();
304 0 ▶ if ($dofilter) {
Branch: 1 branch
BranchTrueFalseTotal
if ($dofilter) { } 0 0 0
305 0 $ocorpus->vlog('info', "$logas: corpus content filters enabled");
306 0 foreach (grep {defined($filters->{$_})} sort keys %$filters) {
307 0 $ocorpus->vlog('info', " + filter $_ => $filters->{$_}");
308 }
309 } else {
310 0 $ocorpus->vlog('info', "$logas: corpus content filters disabled");
311 }
312  
313 ##-- common data
314 0 my $nfiles = $icorpus->size();
315 0 ▶ my $logFileN = $ocorpus->{logFileN} || int($nfiles / 20) || 1;
Condition0%0/5
$ocorpus->{'logFileN'} || int $nfiles / 20 || 1
l!l
00
$ocorpus->{"logFileN"} or int $nfiles / 20
l!l&&r!l&&!r
000
MC/DC0%0/2
$ocorpus->{'logFileN'} || int $nfiles / 20 || 1
$ocorpus->{"logFileN"} int $nfiles / 20
Truth table0%0/3
A or B
A= $ocorpus->{"logFileN"}B= int $nfiles / 20
ABresult
1X1
011
000
316 0 my @outkeys = keys %{DiaColloDB::Document->new};
317  
318 0 my $osize = $ocorpus->size();
319 0 my $outdir = $ocorpus->datadir();
320  
321 0 my $filei_shared = 0;
322 0 share( $filei_shared );
323  
324 ##--------------------------------------------
325 0 ▶ my $cb_worker = sub {
Subroutine __ANON__: not called CC=38 SCAR=73.0
326 0 ▶ my $thrid = shift || DiaColloDB::threads->tid();
Condition0%0/3
shift() || 'DiaColloDB::threads'->tid
l!l&&r!l&&!r
000
MC/DC0%0/2
shift() || 'DiaColloDB::threads'->tid
shift() 'DiaColloDB::threads'->tid
Truth table0%0/3
A || B
A= shift()B= 'DiaColloDB::threads'->tid
ABresult
1X1
011
000
327 0 $logas .= "#$thrid";
328 0 (*STDERR)->autoflush(1);
329 0 $ocorpus->vlog($ocorpus->{logThreads}, "$logas: starting worker thread #$thrid");
330  
331 ##-- initialize: disable auto-deletion
332 0 $ocorpus->{temp} = 0;
333  
334 ##-- initialize filters (formerly in DiaColloDB.pm)
335 0 ▶ my $cfilters = $dofilter ? $filters->compile() : {}
Branch: 2 branches
BranchTrueFalseTotal
my $cfilters = $dofilter ? $filters->compile : {} or $ocorpus->logconfess("${logas}: failed to compile corpus content filters: $!") 0 0 0
$dofilter ? : 0 0 0
336 or $ocorpus->logconfess("$logas: failed to compile corpus content filters: $!");
337 ##
338 ##-- initialize: filters: variables
339 0 my ($pgood, $pbad, $wgood, $wbad, $lgood, $lbad ) = @$cfilters{map {("${_}good","${_}bad")} qw(p w l)};
340 0 my ($pgoodh,$pbadh,$wgoodh,$wbadh,$lgoodh,$lbadh) = @$cfilters{map {("${_}goodfile","${_}badfile")} qw(p w l)};
341 0 my ($tok,$w,$p,$l);
342  
343 0 my ($filei);
344 0 while (1) {
345 {
346 0 lock($filei_shared);
347 0 $filei = $filei_shared;
348 0 ++$filei_shared;
349 }
350 0 ▶ last if ($filei >= $nfiles);
Branch: 1 branch
BranchTrueFalseTotal
if $filei >= $nfiles 0 0 0
351  
352 0 my $idoc = $icorpus->idocument($filei);
353 0 my $infile = $icorpus->ifile($filei);
354 0 my $outfile = "$outdir/".($filei+$osize).".json";
355  
356 #$ocorpus->vlog('info', sprintf("processing files [%3.0f%%]: %s -> %s", 100*($filei-1)/$nfiles, $infile, $outfile))
357 0 ▶ $ocorpus->vlog('info', sprintf("%s: processing files [%3.0f%%]: %s", $logas, 100*($filei-1)/$nfiles, $infile))
Branch: 1 branch
BranchTrueFalseTotal
if $logFileN and $filei % $logFileN == 0 0 0 0
Condition0%0/3
$logFileN and $filei % $logFileN == 0
!ll&&!rl&&r
000
MC/DC0%0/2
$logFileN and $filei % $logFileN == 0
$logFileN $filei % $logFileN == 0
Truth table0%0/3
A and B
A= $logFileNB= $filei % $logFileN == 0
ABresult
0X0
100
111
358 if ($logFileN && ($filei % $logFileN)==0);
359  
360 ##-- apply filters
361 0 ▶ if ($dofilter) {
Branch: 1 branch
BranchTrueFalseTotal
if ($dofilter) 0 0 0
362 0 my $ftokens = [];
363 0 foreach $tok (@{$idoc->{tokens}}) {
364 0 ▶ if (ref($tok)) {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $tok) 0 0 0
365 ##-- normal token: apply filters
366 0 ($w,$p,$l) = @$tok{qw(w p l)};
367 next if ((defined($pgood) && $p !~ $pgood) || ($pgoodh && !exists($pgoodh->{$p}))
368 || (defined($pbad) && $p =~ $pbad) || ($pbadh && exists($pbadh->{$p}))
369 || (defined($wgood) && $w !~ $wgood) || ($wgoodh && !exists($wgoodh->{$w}))
370 || (defined($wbad) && $w =~ $wbad) || ($wbadh && exists($wbadh->{$w}))
371 || (defined($lgood) && $l !~ $lgood) || ($lgoodh && !exists($lgoodh->{$l}))
372 0 ▶ || (defined($lbad) && $l =~ $lbad) || ($lbadh && exists($lbadh->{$l}))
Branch: 1 branch
BranchTrueFalseTotal
if defined $pgood and not $p =~ /$pgood/ or $pgoodh and not exists $pgoodh->{$p} or defined $pbad and $p =~ /$pbad/ or $pbadh and exists $pbadh->{$p} or defined $wgood and not $w =~ /$wgood/ or $wgoodh and not exists $wgoodh->{$w} or defined $wbad and $w =~ /$wbad/ or $wbadh and exists $wbadh->{$w} or defined $lgood and not $l =~ /$lgood/ or $lgoodh and not exists $lgoodh->{$l} or defined $lbad and $l =~ /$lbad/ or $lbadh and exists $lbadh->{$l} 0 0 0
Condition0%0/69
defined $pgood and not $p =~ /$pgood/ or $pgoodh and not exists $pgoodh->{$p} or defined $pbad and $p =~ /$pbad/ or $pbadh and exists $pbadh->{$p} or defined $wgood and not $w =~ /$wgood/ or $wgoodh and not exists $wgoodh->{$w} or defined $wbad and $w =~ /$wbad/ or $wbadh and exists $wbadh->{$w} or defined $lgood and not $l =~ /$lgood/ or $lgoodh and not exists $lgoodh->{$l} or defined $lbad and $l =~ /$lbad/ or $lbadh and exists $lbadh->{$l}
l!l&&r!l&&!r
000
defined $pgood and not $p =~ /$pgood/ or $pgoodh and not exists $pgoodh->{$p} or defined $pbad and $p =~ /$pbad/ or $pbadh and exists $pbadh->{$p} or defined $wgood and not $w =~ /$wgood/ or $wgoodh and not exists $wgoodh->{$w} or defined $wbad and $w =~ /$wbad/ or $wbadh and exists $wbadh->{$w} or defined $lgood and not $l =~ /$lgood/ or $lgoodh and not exists $lgoodh->{$l} or defined $lbad and $l =~ /$lbad/
l!l&&r!l&&!r
000
defined $pgood and not $p =~ /$pgood/ or $pgoodh and not exists $pgoodh->{$p} or defined $pbad and $p =~ /$pbad/ or $pbadh and exists $pbadh->{$p} or defined $wgood and not $w =~ /$wgood/ or $wgoodh and not exists $wgoodh->{$w} or defined $wbad and $w =~ /$wbad/ or $wbadh and exists $wbadh->{$w} or defined $lgood and not $l =~ /$lgood/ or $lgoodh and not exists $lgoodh->{$l}
l!l&&r!l&&!r
000
defined $pgood and not $p =~ /$pgood/ or $pgoodh and not exists $pgoodh->{$p} or defined $pbad and $p =~ /$pbad/ or $pbadh and exists $pbadh->{$p} or defined $wgood and not $w =~ /$wgood/ or $wgoodh and not exists $wgoodh->{$w} or defined $wbad and $w =~ /$wbad/ or $wbadh and exists $wbadh->{$w} or defined $lgood and not $l =~ /$lgood/
l!l&&r!l&&!r
000
defined $pgood and not $p =~ /$pgood/ or $pgoodh and not exists $pgoodh->{$p} or defined $pbad and $p =~ /$pbad/ or $pbadh and exists $pbadh->{$p} or defined $wgood and not $w =~ /$wgood/ or $wgoodh and not exists $wgoodh->{$w} or defined $wbad and $w =~ /$wbad/ or $wbadh and exists $wbadh->{$w}
l!l&&r!l&&!r
000
defined $pgood and not $p =~ /$pgood/ or $pgoodh and not exists $pgoodh->{$p} or defined $pbad and $p =~ /$pbad/ or $pbadh and exists $pbadh->{$p} or defined $wgood and not $w =~ /$wgood/ or $wgoodh and not exists $wgoodh->{$w} or defined $wbad and $w =~ /$wbad/
l!l&&r!l&&!r
000
defined $pgood and not $p =~ /$pgood/ or $pgoodh and not exists $pgoodh->{$p} or defined $pbad and $p =~ /$pbad/ or $pbadh and exists $pbadh->{$p} or defined $wgood and not $w =~ /$wgood/ or $wgoodh and not exists $wgoodh->{$w}
l!l&&r!l&&!r
000
defined $pgood and not $p =~ /$pgood/ or $pgoodh and not exists $pgoodh->{$p} or defined $pbad and $p =~ /$pbad/ or $pbadh and exists $pbadh->{$p} or defined $wgood and not $w =~ /$wgood/
l!l&&r!l&&!r
000
defined $pgood and not $p =~ /$pgood/ or $pgoodh and not exists $pgoodh->{$p} or defined $pbad and $p =~ /$pbad/ or $pbadh and exists $pbadh->{$p}
l!l&&r!l&&!r
000
defined $pgood and not $p =~ /$pgood/ or $pgoodh and not exists $pgoodh->{$p} or defined $pbad and $p =~ /$pbad/
l!l&&r!l&&!r
000
defined $pgood and not $p =~ /$pgood/ or $pgoodh and not exists $pgoodh->{$p}
l!l&&r!l&&!r
000
defined $pgood and not $p =~ /$pgood/
!ll&&!rl&&r
000
$pgoodh and not exists $pgoodh->{$p}
!ll&&!rl&&r
000
defined $pbad and $p =~ /$pbad/
!ll&&!rl&&r
000
$pbadh and exists $pbadh->{$p}
!ll&&!rl&&r
000
defined $wgood and not $w =~ /$wgood/
!ll&&!rl&&r
000
$wgoodh and not exists $wgoodh->{$w}
!ll&&!rl&&r
000
defined $wbad and $w =~ /$wbad/
!ll&&!rl&&r
000
$wbadh and exists $wbadh->{$w}
!ll&&!rl&&r
000
defined $lgood and not $l =~ /$lgood/
!ll&&!rl&&r
000
$lgoodh and not exists $lgoodh->{$l}
!ll&&!rl&&r
000
defined $lbad and $l =~ /$lbad/
!ll&&!rl&&r
000
$lbadh and exists $lbadh->{$l}
!ll&&!rl&&r
000
MC/DC0%0/24
defined $pgood and not $p =~ /$pgood/ or $pgoodh and not exists $pgoodh->{$p} or defined $pbad and $p =~ /$pbad/ or $pbadh and exists $pbadh->{$p} or defined $wgood and not $w =~ /$wgood/ or $wgoodh and not exists $wgoodh->{$w} or defined $wbad and $w =~ /$wbad/ or $wbadh and exists $wbadh->{$w} or defined $lgood and not $l =~ /$lgood/ or $lgoodh and not exists $lgoodh->{$l} or defined $lbad and $l =~ /$lbad/ or $lbadh and exists $lbadh->{$l}
too many conditions
373 );
374 }
375 0 ▶ push(@$ftokens,$tok) if (defined($tok) || (@$ftokens && defined($ftokens->[$#$ftokens])));
Branch: 1 branch
BranchTrueFalseTotal
if defined $tok or @$ftokens and defined $$ftokens[$ftokens->$#*] 0 0 0
Condition0%0/6
defined $tok or @$ftokens and defined $$ftokens[$ftokens->$#*]
l!l&&r!l&&!r
000
@$ftokens and defined $$ftokens[$ftokens->$#*]
!ll&&!rl&&r
000
MC/DC0%0/3
defined $tok or @$ftokens and defined $$ftokens[$ftokens->$#*]
defined $tok @$ftokens defined $$ftokens[$ftokens->$#*]
Truth table0%0/4
A or B and C
A= defined $tokB= @$ftokensC= defined $$ftokens[$ftokens->$#*]
ABCresult
1XX1
0111
00X0
0100
376 }
377 0 $idoc->{tokens} = $ftokens;
378 }
379  
380 ##-- create output document
381 0 my $odoc = {};
382 0 @$odoc{@outkeys} = @$idoc{@outkeys};
383  
384 ##-- dump output document (json)
385 0 ▶ DiaColloDB::Utils::saveJsonFile($odoc,$outfile, pretty=>0,canonical=>0)
Branch: 1 branch
BranchTrueFalseTotal
DiaColloDB::Utils::saveJsonFile($odoc, $outfile, "pretty", 0, "canonical", 0) or $ocorpus->logconfess("${logas}: failed to save JSON data for '${infile}' to '${outfile}': $!") 0 0 0
386 or $ocorpus->logconfess("$logas: failed to save JSON data for '$infile' to '$outfile': $!");
387 }
388  
389 0 $ocorpus->vlog($ocorpus->{logThreads}, "$logas: worker thread #$thrid exiting normally");
390 0 $ocorpus->{logOpen} = 'off'; ##-- suppress 'close()' messages from worker threads
391 0 };
392 ##--/cb_worker
393  
394 ##-- spawn workers
395 0 my $njobs = nJobs($ocorpus->{njobs});
396 0 ▶ if ($njobs==0 || !$HAVE_THREADS) {
Branch: 1 branch
BranchTrueFalseTotal
if ($njobs == 0 or not $DiaColloDB::Corpus::Compiled::HAVE_THREADS) { } 0 0 0
Condition0%0/3
$njobs == 0 or not $DiaColloDB::Corpus::Compiled::HAVE_THREADS
l!l&&r!l&&!r
000
MC/DC0%0/2
$njobs == 0 or not $DiaColloDB::Corpus::Compiled::HAVE_THREADS
$njobs == 0 not $DiaColloDB::Corpus::Compiled::HAVE_THREADS
Truth table0%0/3
A or not(B)
A= $njobs == 0B= not $DiaColloDB::Corpus::Compiled::HAVE_THREADS
ABresult
1X1
011
000
397 0 $ocorpus->info("$logas: running in serial mode");
398 0 $cb_worker->(0);
399 } else {
400 0 $ocorpus->info("$logas: running in parallel mode with $njobs job(s)");
401 0 my @workers = (map {threads->new($cb_worker,$_)} (1..$njobs));
402 0 foreach my $thrid (1..$njobs) {
403 0 my $worker = $workers[$thrid-1];
404 0 $worker->join();
405 0 ▶ if (defined(my $err=$worker->error)) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined(my $err = $worker->error)) 0 0 0
406 0 $ocorpus->logconfess("$logas: error for worker thread #$thrid: $err");
407 }
408 }
409 }
410  
411 ##-- adopt list of compiled files
412 0 $ocorpus->{size} += $nfiles;
413  
414 ##-- save header (happens implicitly on DESTROY() via close())
415 #$ocorpus->saveHeader()
416 # or $ocorpus->logconfess("$logas: failed to save header file ", $ocorpus->headerFile, ": $!");
417  
418 0 return $ocorpus;
419 }
420  
421  
422 ##==============================================================================
423 ## Corpus::Compiled API: union
424  
425 ## $ccorpus = $ccorpus->union(\@sources, %opts)
426 ## + merge source corpora \@sources to $opts{dbdir}, destructive
427 ## + each $src in \@sources is either a Corpus::Compiled object or a simple scalar (dbdir of a Corpus::Compiled object)
428 ## + honors $opts{flags} for append and truncate
429 ## + no filters are applied
430 0 ▶sub union {
Subroutine union: not called CC=15 SCAR=54.8
Pod documented
431 0 my ($that,$sources,%opts) = @_;
432 0 ▶ my $ocorpus = ref($that) ? $that : $that->new();
Branch: 1 branch
BranchTrueFalseTotal
ref $that ? : 0 0 0
433 0 my $logas = 'union()';
434 0 $ocorpus->vlog('info',$logas);
435  
436 ##-- save options before open()
437 my $odir = $ocorpus->dbdir($opts{dbdir})
438 0 ▶ or $ocorpus->logconfess("$logas: no output corpus {dbdir} specified");
Branch: 1 branch
BranchTrueFalseTotal
my $odir = $ocorpus->dbdir($opts{"dbdir"}) or $ocorpus->logconfess("${logas}: no output corpus {dbdir} specified") 0 0 0
439 0 ▶ my $flags = (fcflags($ocorpus->{flags}) | fcflags($opts{flags})) || fcflags('w');
Condition0%0/3
fcflags($ocorpus->{'flags'}) | fcflags($opts{'flags'}) || fcflags('w')
l!l&&r!l&&!r
000
MC/DC0%0/2
fcflags($ocorpus->{'flags'}) | fcflags($opts{'flags'}) || fcflags('w')
fcflags($ocorpus->{'flags'}) | fcflags($opts{'flags'}) fcflags('w')
Truth table0%0/3
A || B
A= fcflags($ocorpus->{'flags'}) | fcflags($opts{'flags'})B= fcflags('w')
ABresult
1X1
011
000
440 0 delete $opts{dbdir};
441  
442 ##-- (re-)open output corpus
443 0 ▶ if (!$ocorpus->opened || ($ocorpus->{dbdir} ne $odir)) {
Branch: 1 branch
BranchTrueFalseTotal
if (not $ocorpus->opened or $ocorpus->{"dbdir"} ne $odir) 0 0 0
Condition0%0/3
not $ocorpus->opened or $ocorpus->{"dbdir"} ne $odir
l!l&&r!l&&!r
000
MC/DC0%0/2
not $ocorpus->opened or $ocorpus->{"dbdir"} ne $odir
not $ocorpus->opened $ocorpus->{"dbdir"} ne $odir
Truth table0%0/3
not(A) or B
A= not $ocorpus->openedB= $ocorpus->{"dbdir"} ne $odir
ABresult
1X1
011
000
444 0 ▶ $ocorpus->open([$odir], %opts, flags=>$flags)
Branch: 1 branch
BranchTrueFalseTotal
$ocorpus->open([$odir], %opts, "flags", $flags) or $ocorpus->logconfess("${logas}: failed to (re-)open output corpus '${odir}' in mode '", fcperl($flags)) 0 0 0
445 or $ocorpus->logconfess("$logas: failed to (re-)open output corpus '$odir' in mode '", fcperl($flags));
446 }
447 0 @$ocorpus{keys %opts} = values %opts;
448  
449 ##-- union: guts
450 0 ▶ foreach my $src (UNIVERSAL::isa($sources,'ARRAY') ? @$sources : $sources) {
Branch: 1 branch
BranchTrueFalseTotal
UNIVERSAL::isa($sources, 'ARRAY') ? : 0 0 0
451 0 ▶ my $idir = ref($src) ? $src->{dbdir} : $src;
Branch: 1 branch
BranchTrueFalseTotal
ref $src ? : 0 0 0
452 0 $ocorpus->vlog('info',"$logas: processing $idir");
453  
454 0 ▶ my $icorpus = ref($src) ? $src : DiaColloDB::Corpus::Compiled->new(dbdir=>$src,logOpen=>undef)
Branch: 2 branches
BranchTrueFalseTotal
my $icorpus = ref $src ? $src : "DiaColloDB::Corpus::Compiled"->new("dbdir", $src, "logOpen", undef) or $ocorpus->logconfess("union(): failed to open input corpus '${src}': $!") 0 0 0
ref $src ? : 0 0 0
455 or $ocorpus->logconfess("union(): failed to open input corpus '$src': $!");
456  
457 0 my $nifiles = $icorpus->{size};
458 0 my $osize = $ocorpus->size;
459  
460 0 my ($filei,$infile,$outfile);
461 0 ▶ for ($filei=0; $filei < $nifiles; ++$filei) {
Branch: 1 branch
BranchTrueFalseTotal
if ($filei < $nifiles) 0 0 0
462 0 $infile = $icorpus->ifile($filei);
463 0 $outfile = "$odir/".($filei+$osize).".json";
464  
465 ##-- link
466 0 ▶ link($infile,$outfile)
Branch: 1 branch
BranchTrueFalseTotal
link $infile, $outfile or symlink $infile, $outfile or $ocorpus->logconfess("union(): failed to create output link $outfile -> ${infile}: $!") 0 0 0
Condition0%0/3
link $infile, $outfile or symlink $infile, $outfile
l!l&&r!l&&!r
000
MC/DC0%0/2
link $infile, $outfile or symlink $infile, $outfile
link $infile, $outfile symlink $infile, $outfile
Truth table0%0/3
A or B
A= link $infile, $outfileB= symlink $infile, $outfile
ABresult
1X1
011
000
467 or symlink($infile,$outfile)
468 or $ocorpus->logconfess("union(): failed to create output link $outfile -> $infile: $!");
469 }
470 0 $ocorpus->{size} += $nifiles;
471 }
472  
473 ##-- all done
474 #$ocorpus->vlog('info', "merged ", scalar(@$sources), " input corpora to $odir");
475 0 return $ocorpus;
476 }
477  
478  
479 ##==============================================================================
480 ## Footer
481 1 1;
482  
483 __END__
« DiaColloDB/Relation.pm ↑ Summary DiaColloDB/Compat/v0_09/Relation.pm »