source: gsdl/trunk/perllib/basebuilder.pm@ 14934

Last change on this file since 14934 was 14934, checked in by davidb, 16 years ago

Changes to allow statistic calculations for metadata coverage, i.e. for this docment which metadata set prefixes are used, which fields within those prefixes are used, and how many times. This is then agregated over the all documents and the summary stored as collection level metadata.

  • Property svn:keywords set to Author Date Id Revision
File size: 20.4 KB
Line 
1###########################################################################
2#
3# basebuilder.pm -- base class for collection builders
4# A component of the Greenstone digital library software
5# from the New Zealand Digital Library Project at the
6# University of Waikato, New Zealand.
7#
8# Copyright (C) 1999 New Zealand Digital Library Project
9#
10# This program is free software; you can redistribute it and/or modify
11# it under the terms of the GNU General Public License as published by
12# the Free Software Foundation; either version 2 of the License, or
13# (at your option) any later version.
14#
15# This program is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18# GNU General Public License for more details.
19#
20# You should have received a copy of the GNU General Public License
21# along with this program; if not, write to the Free Software
22# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23#
24###########################################################################
25
26package basebuilder;
27
28use strict;
29no strict 'refs'; # allow filehandles to be variables and viceversa
30
31use classify;
32use cfgread;
33use colcfg;
34use plugin;
35use util;
36use FileHandle;
37
38BEGIN {
39 # set autoflush on for STDERR and STDOUT so that mgpp
40 # doesn't get out of sync with plugins
41 STDOUT->autoflush(1);
42 STDERR->autoflush(1);
43}
44
45END {
46 STDOUT->autoflush(0);
47 STDERR->autoflush(0);
48}
49
50our $maxdocsize = 12000;
51
52# used to signify "gs2"(default) or "gs3"
53my $gs_mode = "gs2";
54
55sub new {
56 my ($class, $collection, $source_dir, $build_dir, $verbosity,
57 $maxdocs, $debug, $keepold, $incremental, $incremental_dlc,
58 $remove_empty_classifications,
59 $outhandle, $no_text, $failhandle, $gli, $disable_OAI) = @_;
60
61 $outhandle = *STDERR unless defined $outhandle;
62 $no_text = 0 unless defined $no_text;
63 $failhandle = *STDERR unless defined $failhandle;
64
65 # create a builder object
66 my $self = bless {'collection'=>$collection,
67 'source_dir'=>$source_dir,
68 'build_dir'=>$build_dir,
69 'verbosity'=>$verbosity,
70 'maxdocs'=>$maxdocs,
71 'debug'=>$debug,
72 'keepold'=>$keepold,
73 'incremental'=>$incremental,
74 'incremental_dlc' => $incremental_dlc,
75 'remove_empty_classifications'=>$remove_empty_classifications,
76 'outhandle'=>$outhandle,
77 'no_text'=>$no_text,
78 'failhandle'=>$failhandle,
79 'notbuilt'=>{}, # indexes not built
80 'gli'=>$gli,
81 'disable_OAI'=>$disable_OAI
82 }, $class;
83
84 $self->{'gli'} = 0 unless defined $self->{'gli'};
85
86 # disable_OIA applies to greenstone 3 only and is only passed to &colcfg::write_build_cfg_xml (then cfgread4gs3::write_cfg_file) when writing the buildConfig.xml
87 $self->{'disable_OAI'} = 0 unless defined $self->{'disable_OAI'};
88
89 # Read in the collection configuration file.
90 my ($colcfgname);
91 ($colcfgname, $gs_mode) = &colcfg::get_collect_cfg_name($outhandle);
92 if ($gs_mode eq "gs2") {
93 $self->{'collect_cfg'} = &colcfg::read_collect_cfg ($colcfgname);
94 } elsif ($gs_mode eq "gs3") {
95 $self->{'collect_cfg'} = &colcfg::read_collection_cfg_xml ($colcfgname);
96
97 #this $self->{'collect_cfg_preserve'} is used for gs3 only and to be passed to &colcfg::write_build_cfg_xml in sub make_auxilary_files later in this basebuilder.pm, we use this preserve object because $self->{'collect_cfg'}->{'classify'} somewhat gets modified during the calling of &classify::load_classifiers.
98 $self->{'collect_cfg_preserve'} = &colcfg::read_collection_cfg_xml ($colcfgname);
99 }
100
101 # get the list of plugins for this collection
102 my $plugins = [];
103 if (defined $self->{'collect_cfg'}->{'plugin'}) {
104 $plugins = $self->{'collect_cfg'}->{'plugin'};
105 }
106
107 # load all the plugins
108
109 #build up the extra global options for the plugins
110 my @global_opts = ();
111 if (defined $self->{'collect_cfg'}->{'separate_cjk'} && $self->{'collect_cfg'}->{'separate_cjk'} =~ /^true$/i) {
112 push @global_opts, "-separate_cjk";
113 }
114 $self->{'pluginfo'} = &plugin::load_plugins ($plugins, $verbosity, $outhandle, $failhandle, \@global_opts, $keepold);
115
116 if (scalar(@{$self->{'pluginfo'}}) == 0) {
117 print $outhandle "No plugins were loaded.\n";
118 die "\n";
119 }
120
121 # get the list of classifiers for this collection
122 my $classifiers = [];
123 if (defined $self->{'collect_cfg'}->{'classify'}) {
124 $classifiers = $self->{'collect_cfg'}->{'classify'};
125 }
126
127 # load all the classifiers
128 $self->{'classifiers'} = &classify::load_classifiers ($classifiers, $build_dir, $outhandle);
129
130 # load up any dontgdbm fields
131 $self->{'dontgdbm'} = {};
132 if (defined ($self->{'collect_cfg'}->{'dontgdbm'})) {
133 foreach my $dg (@{$self->{'collect_cfg'}->{'dontgdbm'}}) {
134 $self->{'dontgdbm'}->{$dg} = 1;
135 }
136 }
137
138 $self->{'maxnumeric'} = 4;
139 return $self;
140}
141
142# stuff has been moved here from new, so we can use subclass methods
143sub init {
144 my $self = shift(@_);
145
146 $self->generate_index_list();
147 $self->generate_index_options();
148
149 # sort out subcollection indexes
150 if (defined $self->{'collect_cfg'}->{'indexsubcollections'}) {
151 my $indexes = $self->{'collect_cfg'}->{'indexes'};
152 $self->{'collect_cfg'}->{'indexes'} = [];
153 foreach my $subcollection (@{$self->{'collect_cfg'}->{'indexsubcollections'}}) {
154 foreach my $index (@$indexes) {
155 push (@{$self->{'collect_cfg'}->{'indexes'}}, "$index:$subcollection");
156 }
157 }
158 }
159
160 # sort out language subindexes
161 if (defined $self->{'collect_cfg'}->{'languages'}) {
162 my $indexes = $self->{'collect_cfg'}->{'indexes'};
163 $self->{'collect_cfg'}->{'indexes'} = [];
164 foreach my $language (@{$self->{'collect_cfg'}->{'languages'}}) {
165 foreach my $index (@$indexes) {
166 if (defined ($self->{'collect_cfg'}->{'indexsubcollections'})) {
167 push (@{$self->{'collect_cfg'}->{'indexes'}}, "$index:$language");
168 }
169 else { # add in an empty subcollection field
170 push (@{$self->{'collect_cfg'}->{'indexes'}}, "$index\:\:$language");
171 }
172 }
173 }
174 }
175
176 if (defined($self->{'collect_cfg'}->{'indexes'})) {
177 # make sure that the same index isn't specified more than once
178 my %tmphash = ();
179 my @tmparray = @{$self->{'collect_cfg'}->{'indexes'}};
180 $self->{'collect_cfg'}->{'indexes'} = [];
181 foreach my $i (@tmparray) {
182 if (!defined ($tmphash{$i})) {
183 push (@{$self->{'collect_cfg'}->{'indexes'}}, $i);
184 $tmphash{$i} = 1;
185 }
186 }
187 } else {
188 $self->{'collect_cfg'}->{'indexes'} = [];
189 }
190
191 # load up the document processor for building
192 # if a buildproc class has been created for this collection, use it
193 # otherwise, use the mg buildproc
194 my ($buildprocdir, $buildproctype);
195 my $collection = $self->{'collection'};
196 if (-e "$ENV{'GSDLCOLLECTDIR'}/custom/${collection}/perllib/custombuildproc.pm") {
197 $buildprocdir = "$ENV{'GSDLCOLLECTDIR'}/custom/${collection}/perllib";
198 $buildproctype = "custombuildproc";
199 } elsif (-e "$ENV{'GSDLCOLLECTDIR'}/perllib/custombuildproc.pm") {
200 $buildprocdir = "$ENV{'GSDLCOLLECTDIR'}/perllib";
201 $buildproctype = "custombuildproc";
202 } elsif (-e "$ENV{'GSDLCOLLECTDIR'}/perllib/${collection}buildproc.pm") {
203 $buildprocdir = "$ENV{'GSDLCOLLECTDIR'}/perllib";
204 $buildproctype = "${collection}buildproc";
205 } else {
206 $buildprocdir = "$ENV{'GSDLHOME'}/perllib";
207 $buildproctype = $self->default_buildproc();
208 }
209 require "$buildprocdir/$buildproctype.pm";
210
211 eval("\$self->{'buildproc'} = new $buildproctype(\$self->{'collection'}, " .
212 "\$self->{'source_dir'}, \$self->{'build_dir'}, \$self->{'keepold'}, \$self->{'verbosity'}, \$self->{'outhandle'})");
213 die "$@" if $@;
214
215 if (!$self->{'debug'} && !$self->{'keepold'}) {
216 # remove any old builds
217 &util::rm_r($self->{'build_dir'});
218 &util::mk_all_dir($self->{'build_dir'});
219
220 # make the text directory
221 my $textdir = "$self->{'build_dir'}/text";
222 &util::mk_all_dir($textdir);
223 }
224
225}
226
227sub deinit {
228 my $self = shift (@_);
229
230 &plugin::deinit($self->{'pluginfo'},$self->{'buildproc'});
231}
232
233sub set_sections_index_document_metadata {
234 my $self = shift (@_);
235 my ($index) = @_;
236
237 $self->{'buildproc'}->set_sections_index_document_metadata($index);
238}
239
240sub set_maxnumeric {
241 my $self = shift (@_);
242 my ($maxnumeric) = @_;
243
244 $self->{'maxnumeric'} = $maxnumeric;
245}
246sub set_strip_html {
247 my $self = shift (@_);
248 my ($strip) = @_;
249
250 $self->{'strip_html'} = $strip;
251 $self->{'buildproc'}->set_strip_html($strip);
252}
253
254sub compress_text {
255 my $self = shift (@_);
256 my ($textindex) = @_;
257
258 print STDERR "compress_text() should be implemented in subclass!!";
259 return;
260}
261
262
263sub build_indexes {
264 my $self = shift (@_);
265 my ($indexname) = @_;
266 my $outhandle = $self->{'outhandle'};
267
268 my $indexes = [];
269 if (defined $indexname && $indexname =~ /\w/) {
270 push @$indexes, $indexname;
271 } else {
272 $indexes = $self->{'collect_cfg'}->{'indexes'};
273 }
274
275 # create the mapping between the index descriptions
276 # and their directory names (includes subcolls and langs)
277 $self->{'index_mapping'} = $self->create_index_mapping ($indexes);
278
279 # build each of the indexes
280 foreach my $index (@$indexes) {
281 if ($self->want_built($index)) {
282 print $outhandle "\n*** building index $index in subdirectory " .
283 "$self->{'index_mapping'}->{$index}\n" if ($self->{'verbosity'} >= 1);
284 print STDERR "<Stage name='Index' source='$index'>\n" if $self->{'gli'};
285 $self->build_index($index);
286 } else {
287 print $outhandle "\n*** ignoring index $index\n" if ($self->{'verbosity'} >= 1);
288 }
289 }
290
291 $self->build_indexes_extra();
292
293}
294
295sub build_indexes_extra {
296 my $self = shift(@_);
297
298}
299
300sub build_index {
301 my $self = shift (@_);
302 my ($index) = @_;
303
304 print STDERR "build_index should be implemented in subclass\n";
305 return;
306}
307
308
309
310sub make_infodatabase {
311 my $self = shift (@_);
312 my $outhandle = $self->{'outhandle'};
313
314 print STDERR "BuildDir: $self->{'build_dir'}\n";
315
316 my $textdir = &util::filename_cat($self->{'build_dir'}, "text");
317 my $assocdir = &util::filename_cat($self->{'build_dir'}, "assoc");
318 &util::mk_all_dir ($textdir);
319 &util::mk_all_dir ($assocdir);
320
321 # get db name
322 my $dbext = ".bdb";
323 $dbext = ".ldb" if &util::is_little_endian();
324 my $fulldbname = &util::filename_cat ($textdir, "$self->{'collection'}$dbext");
325 $fulldbname =~ s/\//\\/g if ($ENV{'GSDLOS'} =~ /^windows$/i);
326
327 my $exedir = "$ENV{'GSDLHOME'}/bin/$ENV{'GSDLOS'}";
328 my $exe = &util::get_os_exe ();
329 my $txt2db_exe = &util::filename_cat($exedir, "txt2db$exe");
330
331 print $outhandle "\n*** creating the info database and processing associated files\n"
332 if ($self->{'verbosity'} >= 1);
333 print STDERR "<Stage name='CreateInfoData'>\n" if $self->{'gli'};
334
335 # init all the classifiers
336 &classify::init_classifiers ($self->{'classifiers'});
337
338
339 my $reconstructed_docs = undef;
340 if ($self->{'keepold'}) {
341 # reconstruct doc_obj metadata from gdbm for all docs
342 $reconstructed_docs = &classify::reconstruct_doc_objs_metadata($fulldbname);
343 }
344
345 # set up the document processor
346 my ($handle);
347 if ($self->{'debug'}) {
348 $handle = *STDOUT;
349 } else {
350 if (!-e "$txt2db_exe" || !open (PIPEOUT, "| txt2db$exe \"$fulldbname\"")) {
351 print STDERR "<FatalError name='NoRunText2DB'/>\n</Stage>\n" if $self->{'gli'};
352 die "builder::make_infodatabase - couldn't run $txt2db_exe\n";
353 }
354 $handle = *PIPEOUT;
355 }
356
357 $self->{'buildproc'}->set_output_handle ($handle);
358 $self->{'buildproc'}->set_mode ('infodb');
359 $self->{'buildproc'}->set_assocdir ($assocdir);
360 $self->{'buildproc'}->set_dontgdbm ($self->{'dontgdbm'});
361 $self->{'buildproc'}->set_classifiers ($self->{'classifiers'});
362 $self->{'buildproc'}->set_indexing_text (0);
363 $self->{'buildproc'}->set_store_text(1);
364
365 # make_infodatabase needs full reset even for incremental build
366 # as incremental works by reconstructing all docs from GDBM and
367 # then adding in the new ones
368 $self->{'buildproc'}->zero_reset();
369
370 $self->{'buildproc'}->{'mdprefix_fields'} = {};
371
372 if ($self->{'keepold'}) {
373 # create flat classify structure, ready for new docs to be added
374 foreach my $doc_obj ( @$reconstructed_docs ) {
375 print $outhandle " Adding reconstructed ", $doc_obj->get_OID(), " into classify structures\n";
376 $self->{'buildproc'}->process($doc_obj,undef);
377 }
378 }
379
380
381 &plugin::read ($self->{'pluginfo'}, $self->{'source_dir'},
382 "", {}, $self->{'buildproc'}, $self->{'maxdocs'},0, $self->{'gli'});
383
384 # this has changed to only output collection meta if its
385 # not in the config file
386 $self->output_collection_meta($handle);
387
388 # output classification information
389 &classify::output_classify_info ($self->{'classifiers'}, $handle,
390 $self->{'remove_empty_classifications'},
391 $self->{'gli'});
392
393 # Output classifier reverse lookup, used in incremental deletion
394 #&classify::print_reverse_lookup($handle);
395
396 #output doclist
397 my @doclist = $self->{'buildproc'}->get_doc_list();
398 my $docs = join (";",@doclist);
399 print $handle "[browselist]\n";
400 print $handle "<hastxt>0\n";
401 print $handle "<childtype>VList\n";
402 print $handle "<numleafdocs>" . ($#doclist+1) . "\n";
403 print $handle "<thistype>Invisible\n";
404 print $handle "<contains>$docs";
405 print $handle "\n" . ('-' x 70) . "\n";
406
407 close ($handle) if !$self->{'debug'};
408
409 print STDERR "</Stage>\n" if $self->{'gli'};
410}
411
412sub make_auxiliary_files {
413 my $self = shift (@_);
414 my ($index);
415 my $build_cfg = {};
416 # subclasses may have already defined stuff in here
417 if (defined $self->{'build_cfg'}) {
418 $build_cfg = $self->{'build_cfg'};
419 }
420
421 my $outhandle = $self->{'outhandle'};
422
423 print $outhandle "\n*** creating auxiliary files \n" if ($self->{'verbosity'} >= 1);
424 print STDERR "<Stage name='CreatingAuxilary'>\n" if $self->{'gli'};
425
426 # get the text directory
427 &util::mk_all_dir ($self->{'build_dir'});
428
429 # store the build date
430 $build_cfg->{'builddate'} = time;
431 $build_cfg->{'buildtype'} = $self->{'buildtype'};
432 $build_cfg->{'indexstem'} = $self->{'collection'};
433 $build_cfg->{'stemindexes'} = $self->{'stemindexes'};
434
435 # store the number of documents and number of bytes
436 $build_cfg->{'numdocs'} = $self->{'buildproc'}->get_num_docs();
437 $build_cfg->{'numsections'} = $self->{'buildproc'}->get_num_sections();
438 $build_cfg->{'numbytes'} = $self->{'buildproc'}->get_num_bytes();
439
440 # store the mapping between the index names and the directory names
441 # the index map is used to determine what indexes there are, so any that are not built should not be put into the map.
442 my @indexmap = ();
443 foreach my $index (@{$self->{'index_mapping'}->{'indexmaporder'}}) {
444 if (not defined ($self->{'notbuilt'}->{$index})) {
445 push (@indexmap, "$index\-\>$self->{'index_mapping'}->{'indexmap'}->{$index}");
446 }
447 }
448 $build_cfg->{'indexmap'} = \@indexmap if scalar (@indexmap);
449
450 my @subcollectionmap = ();
451 foreach my $subcollection (@{$self->{'index_mapping'}->{'subcollectionmaporder'}}) {
452 push (@subcollectionmap, "$subcollection\-\>" .
453 $self->{'index_mapping'}->{'subcollectionmap'}->{$subcollection});
454 }
455 $build_cfg->{'subcollectionmap'} = \@subcollectionmap if scalar (@subcollectionmap);
456
457 my @languagemap = ();
458 foreach my $language (@{$self->{'index_mapping'}->{'languagemaporder'}}) {
459 push (@languagemap, "$language\-\>" .
460 $self->{'index_mapping'}->{'languagemap'}->{$language});
461 }
462 $build_cfg->{'languagemap'} = \@languagemap if scalar (@languagemap);
463
464 my @notbuilt = ();
465 foreach my $nb (keys %{$self->{'notbuilt'}}) {
466 push (@notbuilt, $nb);
467 }
468 $build_cfg->{'notbuilt'} = \@notbuilt if scalar (@notbuilt);
469
470 $build_cfg->{'maxnumeric'} = $self->{'maxnumeric'};
471
472 $self->build_cfg_extra($build_cfg);
473
474 if ($gs_mode eq "gs2") {
475 &colcfg::write_build_cfg("$self->{'build_dir'}/build.cfg", $build_cfg);
476 }
477 if ($gs_mode eq "gs3") {
478
479 &colcfg::write_build_cfg_xml("$self->{'build_dir'}/buildConfig.xml", $build_cfg, $self->{'collect_cfg_preserve'}, $self->{'disable_OAI'});
480 }
481
482 print STDERR "</Stage>\n" if $self->{'gli'};
483}
484
485sub collect_specific {
486 my $self = shift (@_);
487}
488
489sub want_built {
490 my $self = shift (@_);
491 my ($index) = @_;
492
493 if (defined ($self->{'collect_cfg'}->{'dontbuild'})) {
494 foreach my $checkstr (@{$self->{'collect_cfg'}->{'dontbuild'}}) {
495 if ($index =~ /^$checkstr$/) {
496 $self->{'notbuilt'}->{$index} = 1;
497 return 0;
498 }
499 }
500 }
501
502 return 1;
503}
504
505sub create_index_mapping {
506 my $self = shift (@_);
507 my ($indexes) = @_;
508
509 print STDERR "create_index_mapping should be implemented in subclass\n";
510 my %mapping = ();
511 return \%mapping;
512}
513
514# returns a processed version of a field.
515# if the field has only one component the processed
516# version will contain the first character and next consonant
517# of that componant - otherwise it will contain the first
518# character of the first two components
519# only uses letdig (\w) characters now
520sub process_field {
521 my $self = shift (@_);
522 my ($field) = @_;
523
524 return "" unless (defined ($field) && $field =~ /\S/);
525
526 my ($a, $b);
527 my @components = split /,/, $field;
528 if (scalar @components >= 2) {
529 # pick the first letdig from the first two field names
530 ($a) = $components[0] =~ /^[^\w]*(\w)/;
531 ($b) = $components[1] =~ /^[^\w]*(\w)/;
532 } else {
533 # pick the first two letdig chars
534 ($a, $b) = $field =~ /^[^\w]*(\w)[^\w]*?(\w)/i;
535 }
536 # there may not have been any letdigs...
537 $a = 'a' unless defined $a;
538 $b = '0' unless defined $b;
539
540 return "$a$b";
541
542}
543
544sub get_next_version {
545 my $self = shift (@_);
546 my ($nameref) = @_;
547 my $num=0;
548 if ($$nameref =~ /(\d\d)$/) {
549 $num = $1; $num ++;
550 $$nameref =~ s/\d\d$/$num/;
551 } elsif ($$nameref =~ /(\d)$/) {
552 $num = $1;
553 if ($num == 9) {$$nameref =~ s/\d$/10/;}
554 else {$num ++; $$nameref =~ s/\d$/$num/;}
555 } else {
556 $$nameref =~ s/.$/0/;
557 }
558}
559
560# implement this in subclass if want to add extra stuff to build.cfg
561sub build_cfg_extra {
562 my $self = shift(@_);
563 my ($build_cfg) = @_;
564
565}
566
567
568
569sub output_collection_meta_start {
570 my $self = shift(@_);
571 my ($handle) = @_;
572
573 print $handle "[collection]\n";
574
575}
576
577sub output_collection_meta_sets {
578 my $self = shift(@_);
579 my ($handle) = @_;
580
581 my $mdprefix_fields = $self->{'buildproc'}->{'mdprefix_fields'};
582
583 foreach my $prefix (keys %$mdprefix_fields)
584 {
585 print $handle "<metadataset>$prefix\n";
586
587 foreach my $field (keys %{$mdprefix_fields->{$prefix}})
588 {
589 my $val = $mdprefix_fields->{$prefix}->{$field};
590
591 print $handle "<metadatalist-$prefix>$field\n";
592 print $handle "<metadatafreq-$prefix-$field>$val\n";
593 }
594
595 }
596
597}
598
599sub output_collection_meta_end {
600 my $self = shift(@_);
601 my ($handle) = @_;
602
603 print $handle ('-' x 70) . "\n";;
604
605}
606
607
608# default is to output the metadata sets (prefixes) used in collection
609
610sub output_collection_meta {
611 my $self = shift(@_);
612 my ($handle) = @_;
613
614 $self->output_collection_meta_start($handle);
615 $self->output_collection_meta_sets($handle);
616 $self->output_collection_meta_end($handle);
617
618}
619
620sub print_stats {
621 my $self = shift (@_);
622
623 my $outhandle = $self->{'outhandle'};
624 my $indexing_text = $self->{'buildproc'}->get_indexing_text();
625 my $index = $self->{'buildproc'}->get_index();
626 my $num_bytes = $self->{'buildproc'}->get_num_bytes();
627 my $num_processed_bytes = $self->{'buildproc'}->get_num_processed_bytes();
628
629 if ($indexing_text) {
630 print $outhandle "Stats (Creating index $index)\n";
631 } else {
632 print $outhandle "Stats (Compressing text from $index)\n";
633 }
634 print $outhandle "Total bytes in collection: $num_bytes\n";
635 print $outhandle "Total bytes in $index: $num_processed_bytes\n";
636
637 if ($num_processed_bytes < 50 && ($indexing_text || !$self->{'no_text'})) {
638
639 if ($self->{'keepold'}) {
640 if ($num_processed_bytes == 0) {
641 if ($indexing_text) {
642 print $outhandle "No additional text was added to $index\n";
643 } elsif (!$self->{'no_text'}) {
644 print $outhandle "No additional text was compressed\n";
645 }
646 }
647 }
648 else {
649 print $outhandle "***************\n";
650 if ($indexing_text) {
651 print $outhandle "WARNING: There is very little or no text to process for $index\n";
652 } elsif (!$self->{'no_text'}) {
653 print $outhandle "WARNING: There is very little or no text to compress\n";
654 }
655 print $outhandle " Was this your intention?\n";
656 print $outhandle "***************\n";
657 }
658
659 }
660
661}
662
663
6641;
665
Note: See TracBrowser for help on using the repository browser.