Changeset 1411


Ignore:
Timestamp:
2000-08-16T18:07:29+12:00 (24 years ago)
Author:
dmm9
Message:

added the options for the date extractor

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/plugins/BasPlug.pm

    r1396 r1411  
    3434use doc;
    3535use diagnostics;
     36use DateExtract;
    3637
    3738sub print_general_usage {
     
    8485    my $self = {};
    8586    my $encodings = "^(iso_8859_1|Latin1|ascii|gb|iso_8859_6|windows_1256|Arabic|utf8|unicode)\$";
    86 
     87    my $year = (localtime)[5]+1900;
    8788    # general options available to all plugins
    8889    if (!parsargv::parse(\@_,
     
    9394             q^markup_acronyms^, \$self->{'markup_acronyms'},
    9495             q^extract_language^, \$self->{'extract_language'},
     96             q^date_extract^, \$self->{'date_extract'},
     97             "maximum_date/\\d{4}/$year", \$self->{'max_year'},
     98             q^no_bibliography^, \$self->{'no_biblio'},
     99             "maximum_century/-?\\d{1,2}( ?B\\.C\\.E\\.)?/-1",
     100             \$self->{'max_century'},
    95101             "allow_extra_options")) {
    96 
     102   
    97103    print STDERR "\nThe $plugin_name plugin uses an incorrect general option (general options are those\n";
    98104    print STDERR "available to all plugins). Check your collect.cfg configuration file.\n";
     
    329335    }
    330336    }
     337
     338     if($self->{'date_extract'}) {
     339     my $thissection = $doc_obj->get_top_section();
     340     while (defined $thissection) {
     341         
     342         my $text = $doc_obj->get_text($thissection);
     343         &DateExtract::get_date_metadata($text, $doc_obj,
     344                         $thissection,
     345                         $self->{'no_biblio'},
     346                         $self->{'max_year'},
     347                         $self->{'max_century'});
     348         $thissection = $doc_obj->get_next_section ($thissection);
     349         }
     350     }
    331351
    332352    if ($self->{'extract_language'}) {
Note: See TracChangeset for help on using the changeset viewer.