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

Last change on this file since 15700 was 15700, checked in by mdewsnip, 16 years ago

(Adding new DB support) Now outputs the "browselist" node using dbutil::write_infodb_entry().

  • 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 dontdb fields
131 $self->{'dontdb'} = {};
132 if (defined ($self->{'collect_cfg'}->{'dontgdbm'})) {
133 foreach my $dg (@{$self->{'collect_cfg'}->{'dontgdbm'}}) {
134 $self->{'dontdb'}->{$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 $dbname = &util::get_dirsep_tail($self->{'collection'}).$dbext;
325 my $fulldbname = &util::filename_cat ($textdir, $dbname);
326 $fulldbname =~ s/\//\\/g if ($ENV{'GSDLOS'} =~ /^windows$/i);
327
328 my $exedir = "$ENV{'GSDLHOME'}/bin/$ENV{'GSDLOS'}";
329 my $exe = &util::get_os_exe ();
330 my $txt2db_exe = &util::filename_cat($exedir, "txt2db$exe");
331
332 print $outhandle "\n*** creating the info database and processing associated files\n"
333 if ($self->{'verbosity'} >= 1);
334 print STDERR "<Stage name='CreateInfoData'>\n" if $self->{'gli'};
335
336 # init all the classifiers
337 &classify::init_classifiers ($self->{'classifiers'});
338
339
340 my $reconstructed_docs = undef;
341 if ($self->{'keepold'}) {
342 # reconstruct doc_obj metadata from database for all docs
343 $reconstructed_docs = &classify::reconstruct_doc_objs_metadata($fulldbname);
344 }
345
346 # set up the document processor
347 my ($infodb_handle);
348 if ($self->{'debug'}) {
349 $infodb_handle = *STDOUT;
350 } else {
351 if (!-e "$txt2db_exe" || !open (PIPEOUT, "| txt2db$exe \"$fulldbname\"")) {
352 print STDERR "<FatalError name='NoRunText2DB'/>\n</Stage>\n" if $self->{'gli'};
353 die "builder::make_infodatabase - couldn't run $txt2db_exe\n";
354 }
355 $infodb_handle = *PIPEOUT;
356 }
357
358 $self->{'buildproc'}->set_output_handle ($infodb_handle);
359 $self->{'buildproc'}->set_mode ('infodb');
360 $self->{'buildproc'}->set_assocdir ($assocdir);
361 $self->{'buildproc'}->set_dontdb ($self->{'dontdb'});
362 $self->{'buildproc'}->set_classifiers ($self->{'classifiers'});
363 $self->{'buildproc'}->set_indexing_text (0);
364 $self->{'buildproc'}->set_store_text(1);
365
366 # make_infodatabase needs full reset even for incremental build
367 # as incremental works by reconstructing all docs from the database and
368 # then adding in the new ones
369 $self->{'buildproc'}->zero_reset();
370
371 $self->{'buildproc'}->{'mdprefix_fields'} = {};
372
373 if ($self->{'keepold'}) {
374 # create flat classify structure, ready for new docs to be added
375 foreach my $doc_obj ( @$reconstructed_docs ) {
376 print $outhandle " Adding reconstructed ", $doc_obj->get_OID(), " into classify structures\n";
377 $self->{'buildproc'}->process($doc_obj,undef);
378 }
379 }
380
381
382 &plugin::read ($self->{'pluginfo'}, $self->{'source_dir'},
383 "", {}, $self->{'buildproc'}, $self->{'maxdocs'},0, $self->{'gli'});
384
385 # this has changed to only output collection meta if its
386 # not in the config file
387 $self->output_collection_meta($infodb_handle);
388
389 # output classification information
390 &classify::output_classify_info ($self->{'classifiers'}, $infodb_handle,
391 $self->{'remove_empty_classifications'},
392 $self->{'gli'});
393
394 # Output classifier reverse lookup, used in incremental deletion
395 #&classify::print_reverse_lookup($infodb_handle);
396
397 # output doclist
398 my @doc_list = $self->{'buildproc'}->get_doc_list();
399 &dbutil::write_infodb_entry($infodb_handle, "browselist", { 'hastxt' => [ "0" ],
400 'childtype' => [ "VList" ],
401 'numleafdocs' => [ scalar(@doc_list) ],
402 'thistype' => [ "Invisible" ],
403 'contains' => [ join(";", @doc_list) ] });
404
405 close ($infodb_handle) if !$self->{'debug'};
406
407 print STDERR "</Stage>\n" if $self->{'gli'};
408}
409
410sub make_auxiliary_files {
411 my $self = shift (@_);
412 my ($index);
413 my $build_cfg = {};
414 # subclasses may have already defined stuff in here
415 if (defined $self->{'build_cfg'}) {
416 $build_cfg = $self->{'build_cfg'};
417 }
418
419 my $outhandle = $self->{'outhandle'};
420
421 print $outhandle "\n*** creating auxiliary files \n" if ($self->{'verbosity'} >= 1);
422 print STDERR "<Stage name='CreatingAuxilary'>\n" if $self->{'gli'};
423
424 # get the text directory
425 &util::mk_all_dir ($self->{'build_dir'});
426
427 # store the build date
428 $build_cfg->{'builddate'} = time;
429 $build_cfg->{'buildtype'} = $self->{'buildtype'};
430 $build_cfg->{'indexstem'} = &util::get_dirsep_tail($self->{'collection'});
431 $build_cfg->{'stemindexes'} = $self->{'stemindexes'};
432
433 # store the number of documents and number of bytes
434 $build_cfg->{'numdocs'} = $self->{'buildproc'}->get_num_docs();
435 $build_cfg->{'numsections'} = $self->{'buildproc'}->get_num_sections();
436 $build_cfg->{'numbytes'} = $self->{'buildproc'}->get_num_bytes();
437
438 # store the mapping between the index names and the directory names
439 # the index map is used to determine what indexes there are, so any that are not built should not be put into the map.
440 my @indexmap = ();
441 foreach my $index (@{$self->{'index_mapping'}->{'indexmaporder'}}) {
442 if (not defined ($self->{'notbuilt'}->{$index})) {
443 push (@indexmap, "$index\-\>$self->{'index_mapping'}->{'indexmap'}->{$index}");
444 }
445 }
446 $build_cfg->{'indexmap'} = \@indexmap if scalar (@indexmap);
447
448 my @subcollectionmap = ();
449 foreach my $subcollection (@{$self->{'index_mapping'}->{'subcollectionmaporder'}}) {
450 push (@subcollectionmap, "$subcollection\-\>" .
451 $self->{'index_mapping'}->{'subcollectionmap'}->{$subcollection});
452 }
453 $build_cfg->{'subcollectionmap'} = \@subcollectionmap if scalar (@subcollectionmap);
454
455 my @languagemap = ();
456 foreach my $language (@{$self->{'index_mapping'}->{'languagemaporder'}}) {
457 push (@languagemap, "$language\-\>" .
458 $self->{'index_mapping'}->{'languagemap'}->{$language});
459 }
460 $build_cfg->{'languagemap'} = \@languagemap if scalar (@languagemap);
461
462 my @notbuilt = ();
463 foreach my $nb (keys %{$self->{'notbuilt'}}) {
464 push (@notbuilt, $nb);
465 }
466 $build_cfg->{'notbuilt'} = \@notbuilt if scalar (@notbuilt);
467
468 $build_cfg->{'maxnumeric'} = $self->{'maxnumeric'};
469
470 $self->build_cfg_extra($build_cfg);
471
472 if ($gs_mode eq "gs2") {
473 &colcfg::write_build_cfg("$self->{'build_dir'}/build.cfg", $build_cfg);
474 }
475 if ($gs_mode eq "gs3") {
476
477 &colcfg::write_build_cfg_xml("$self->{'build_dir'}/buildConfig.xml", $build_cfg, $self->{'collect_cfg_preserve'}, $self->{'disable_OAI'});
478 }
479
480 print STDERR "</Stage>\n" if $self->{'gli'};
481}
482
483sub collect_specific {
484 my $self = shift (@_);
485}
486
487sub want_built {
488 my $self = shift (@_);
489 my ($index) = @_;
490
491 if (defined ($self->{'collect_cfg'}->{'dontbuild'})) {
492 foreach my $checkstr (@{$self->{'collect_cfg'}->{'dontbuild'}}) {
493 if ($index =~ /^$checkstr$/) {
494 $self->{'notbuilt'}->{$index} = 1;
495 return 0;
496 }
497 }
498 }
499
500 return 1;
501}
502
503sub create_index_mapping {
504 my $self = shift (@_);
505 my ($indexes) = @_;
506
507 print STDERR "create_index_mapping should be implemented in subclass\n";
508 my %mapping = ();
509 return \%mapping;
510}
511
512# returns a processed version of a field.
513# if the field has only one component the processed
514# version will contain the first character and next consonant
515# of that componant - otherwise it will contain the first
516# character of the first two components
517# only uses letdig (\w) characters now
518sub process_field {
519 my $self = shift (@_);
520 my ($field) = @_;
521
522 return "" unless (defined ($field) && $field =~ /\S/);
523
524 my ($a, $b);
525 my @components = split /,/, $field;
526 if (scalar @components >= 2) {
527 # pick the first letdig from the first two field names
528 ($a) = $components[0] =~ /^[^\w]*(\w)/;
529 ($b) = $components[1] =~ /^[^\w]*(\w)/;
530 } else {
531 # pick the first two letdig chars
532 ($a, $b) = $field =~ /^[^\w]*(\w)[^\w]*?(\w)/i;
533 }
534 # there may not have been any letdigs...
535 $a = 'a' unless defined $a;
536 $b = '0' unless defined $b;
537
538 return "$a$b";
539
540}
541
542sub get_next_version {
543 my $self = shift (@_);
544 my ($nameref) = @_;
545 my $num=0;
546 if ($$nameref =~ /(\d\d)$/) {
547 $num = $1; $num ++;
548 $$nameref =~ s/\d\d$/$num/;
549 } elsif ($$nameref =~ /(\d)$/) {
550 $num = $1;
551 if ($num == 9) {$$nameref =~ s/\d$/10/;}
552 else {$num ++; $$nameref =~ s/\d$/$num/;}
553 } else {
554 $$nameref =~ s/.$/0/;
555 }
556}
557
558# implement this in subclass if want to add extra stuff to build.cfg
559sub build_cfg_extra {
560 my $self = shift(@_);
561 my ($build_cfg) = @_;
562
563}
564
565
566
567sub output_collection_meta_start {
568 my $self = shift(@_);
569 my ($handle) = @_;
570
571 print $handle "[collection]\n";
572
573}
574
575sub output_collection_meta_sets {
576 my $self = shift(@_);
577 my ($handle) = @_;
578
579 my $mdprefix_fields = $self->{'buildproc'}->{'mdprefix_fields'};
580
581 foreach my $prefix (keys %$mdprefix_fields)
582 {
583 print $handle "<metadataset>$prefix\n";
584
585 foreach my $field (keys %{$mdprefix_fields->{$prefix}})
586 {
587 my $val = $mdprefix_fields->{$prefix}->{$field};
588
589 print $handle "<metadatalist-$prefix>$field\n";
590 print $handle "<metadatafreq-$prefix-$field>$val\n";
591 }
592
593 }
594
595}
596
597sub output_collection_meta_end {
598 my $self = shift(@_);
599 my ($handle) = @_;
600
601 print $handle ('-' x 70) . "\n";;
602
603}
604
605
606# default is to output the metadata sets (prefixes) used in collection
607
608sub output_collection_meta {
609 my $self = shift(@_);
610 my ($handle) = @_;
611
612 $self->output_collection_meta_start($handle);
613 $self->output_collection_meta_sets($handle);
614 $self->output_collection_meta_end($handle);
615
616}
617
618sub print_stats {
619 my $self = shift (@_);
620
621 my $outhandle = $self->{'outhandle'};
622 my $indexing_text = $self->{'buildproc'}->get_indexing_text();
623 my $index = $self->{'buildproc'}->get_index();
624 my $num_bytes = $self->{'buildproc'}->get_num_bytes();
625 my $num_processed_bytes = $self->{'buildproc'}->get_num_processed_bytes();
626
627 if ($indexing_text) {
628 print $outhandle "Stats (Creating index $index)\n";
629 } else {
630 print $outhandle "Stats (Compressing text from $index)\n";
631 }
632 print $outhandle "Total bytes in collection: $num_bytes\n";
633 print $outhandle "Total bytes in $index: $num_processed_bytes\n";
634
635 if ($num_processed_bytes < 50 && ($indexing_text || !$self->{'no_text'})) {
636
637 if ($self->{'keepold'}) {
638 if ($num_processed_bytes == 0) {
639 if ($indexing_text) {
640 print $outhandle "No additional text was added to $index\n";
641 } elsif (!$self->{'no_text'}) {
642 print $outhandle "No additional text was compressed\n";
643 }
644 }
645 }
646 else {
647 print $outhandle "***************\n";
648 if ($indexing_text) {
649 print $outhandle "WARNING: There is very little or no text to process for $index\n";
650 } elsif (!$self->{'no_text'}) {
651 print $outhandle "WARNING: There is very little or no text to compress\n";
652 }
653 print $outhandle " Was this your intention?\n";
654 print $outhandle "***************\n";
655 }
656
657 }
658
659}
660
661
6621;
663
Note: See TracBrowser for help on using the repository browser.