Ignore:
Timestamp:
2000-08-11T13:46:39+12:00 (24 years ago)
Author:
say1
Message:

changed initialisation code for acronyms

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/acronym.pm

    r1393 r1396  
    5050#allow recusive acronyms
    5151my $allow_recursive = "";
     52#let definitions be all capitals
     53my $allow_all_caps = 0;
    5254
    5355my @stop_words = split / /, "OF AT THE IN TO AND";
     
    7577###########################################################################
    7678
    77 sub init_acronyms {
     79sub initialise_acronyms {
    7880   
    7981    my $file_text = "";
     
    102104    print ACRONYM_HANDLE "#minimum acronym length (raise to raise precision)\n";
    103105    print ACRONYM_HANDLE "\$min_def_length = 3;\n\n";
     106    print ACRONYM_HANDLE "#let definitions be all capitals\n";
     107    print ACRONYM_HANDLE "\$allow_all_caps = 0;\n\n";
    104108    print ACRONYM_HANDLE "#minimum acronym length (raise to raise precision)\n";
    105109    print ACRONYM_HANDLE "\$min_acro_length = 3;\n\n";
     
    149153
    150154#close the list of accumulated acronyms
    151 END {
     155sub finalise_acronyms {
    152156    if ($writing_acronyms)
    153157    {
     
    160164sub read_all_acronyms_from_file {
    161165   
    162     my $file_text = "";
     166    my $file_text = " ";
    163167    if (open ACRONYM_HANDLE, "<$acronym_accumulate_file")
    164168    {
     
    415419#       "|" . $self->letters_in_acronym() .
    416420#       "|" . $self->letters_in_acronym_definition() . "\n";
     421    return 0;
     422    }
     423    if (!$allow_all_caps &&
     424    $self->to_def_string() eq uc($self->to_def_string()))
     425    {
     426#   print "acronym " . $self->to_string() . " rejected (all upper)\n";
    417427    return 0;
    418428    }
     
    514524    $$processed_text =~ s/[^A-Za-z]/ /g;
    515525    $$processed_text =~ s/\s+/ /g;
     526    $$processed_text =~ s/(\n|\>)References.*/ /g;
     527    $$processed_text =~ s/(\n|\>)Bibliography.*/ /g;
    516528
    517529    #clear some global variables
     
    633645#&test();
    634646
    635 &init_acronyms();
    636 
    6376471;
    638648
Note: See TracChangeset for help on using the changeset viewer.