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

Last change on this file since 16841 was 16379, checked in by kjdon, 16 years ago

global block pass: added in extra argument to plugin::read calls

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