Changeset 1424 for trunk/gsdl/perllib/plugins/BasPlug.pm
- Timestamp:
- 2000-08-18T17:37:15+12:00 (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/plugins/BasPlug.pm
r1411 r1424 31 31 use acronym; 32 32 use textcat; 33 use strict;34 33 use doc; 35 34 use diagnostics; … … 85 84 my $self = {}; 86 85 my $encodings = "^(iso_8859_1|Latin1|ascii|gb|iso_8859_6|windows_1256|Arabic|utf8|unicode)\$"; 86 $self->{'outhandle'} = STDERR; 87 87 my $year = (localtime)[5]+1900; 88 88 89 # general options available to all plugins 89 90 if (!parsargv::parse(\@_, … … 114 115 sub init { 115 116 my $self = shift (@_); 116 my ($verbosity ) = @_;117 my ($verbosity, $outhandle) = @_; 117 118 118 119 # verbosity is passed through from the processor 119 120 $self->{'verbosity'} = $verbosity; 121 122 # as is the outhandle ... 123 $self->{'outhandle'} = $outhandle if defined $outhandle; 120 124 121 125 # set process_exp and block_exp to defaults unless they were … … 209 213 210 214 if ($text !~ /\w/) { 211 print STDERR "$plugin_name: ERROR: $file contains no text\n" if $self->{'verbosity'}; 215 my $outhandle = $self->{'outhandle'}; 216 print $outhandle "$plugin_name: ERROR: $file contains no text\n" if $self->{'verbosity'}; 212 217 return 0; 213 218 } … … 387 392 388 393 # extract acronyms from a section in a document. progress is 389 # reported to STDERRbased on the verbosity. both the Acronym394 # reported to outhandle based on the verbosity. both the Acronym 390 395 # and the AcronymKWIC metadata items are created. 391 396 … … 393 398 my $self = shift (@_); 394 399 my ($textref, $doc_obj, $thissection) = @_; 395 396 print STDERR " extracting acronyms ...\n" 400 my $outhandle = $self->{'outhandle'}; 401 402 print $outhandle " extracting acronyms ...\n" 397 403 if ($self->{'verbosity'} >= 2); 398 404 … … 408 414 { 409 415 $seen_before = "true"; 410 print STDERR" already seen ". $acro->to_string() . "\n"416 print $outhandle " already seen ". $acro->to_string() . "\n" 411 417 if ($self->{'verbosity'} >= 2); 412 418 } … … 420 426 #do the normal acronym 421 427 $doc_obj->add_utf8_metadata($thissection, "Acronym", $acro->to_string()); 422 print STDERR" adding ". $acro->to_string() . "\n"428 print $outhandle " adding ". $acro->to_string() . "\n" 423 429 if ($self->{'verbosity'} >= 1); 424 430 … … 432 438 } 433 439 } 434 print STDERR" done extracting acronyms. \n"440 print $outhandle " done extracting acronyms. \n" 435 441 if ($self->{'verbosity'} >= 2); 436 442 } … … 439 445 my $self = shift (@_); 440 446 my ($text, $doc_obj, $thissection) = @_; 441 442 print STDERR " marking up acronyms ...\n" 447 my $outhandle = $self->{'outhandle'}; 448 449 print $outhandle " marking up acronyms ...\n" 443 450 if ($self->{'verbosity'} >= 2); 444 451 … … 446 453 $text = &acronym::markup_acronyms($text, $self); 447 454 448 print STDERR" done marking up acronyms. \n"455 print $outhandle " done marking up acronyms. \n" 449 456 if ($self->{'verbosity'} >= 2); 450 457
Note:
See TracChangeset
for help on using the changeset viewer.