Changeset 15117
- Timestamp:
- 2008-03-20T20:54:49+13:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/perllib/acronym.pm
r7645 r15117 58 58 my @acronym_list = (); 59 59 60 #the file to collate acronyms into61 my $acronym_accumulate_file = $ENV{'GSDLCOLLECTDIR'} . "/etc/acronym_definitions.pm";62 my $acronym_options_file = $ENV{'GSDLCOLLECTDIR'} . "/etc/acronym_options.pm";63 60 64 61 my %acronyms_found_in_collection = (); … … 87 84 my $local_allow_all_caps = $allow_all_caps; 88 85 my @local_stop_words = @stop_words; 89 my $local_acronym_accumulate_file = $acronym_accumulate_file; 90 91 86 87 88 # the file to collate acronyms into 89 90 my $def_acronym_acc_file_pm = '&util::filename_cat($ENV{\'GSDLCOLLECTDIR\'}, "etc","acronym_definitions.pm");'; 91 my $acronym_accumulate_file = eval { $def_acronym_acc_file_pm }; 92 my $acronym_options_file = &util::filename_cat($ENV{'GSDLCOLLECTDIR'},"etc","acronym_options.pm"); 93 94 92 95 my $file_text = ""; 93 96 if (open ACRONYM_HANDLE, "<$acronym_options_file") … … 99 102 print STDERR "failed to open $acronym_options_file\n"; 100 103 open ACRONYM_HANDLE, ">$acronym_options_file\n"; 104 print ACRONYM_HANDLE "use util;\n"; 101 105 print ACRONYM_HANDLE "#Config file for acronym extraction. EDIT THIS FILE, it should\n"; 102 106 print ACRONYM_HANDLE "#not be overridden by the software. It's read by GSDL using perl's\n"; … … 129 133 print ACRONYM_HANDLE "\n"; 130 134 print ACRONYM_HANDLE "#the file to collate acronyms into\n"; 131 print ACRONYM_HANDLE "\$ local_acronym_accumulate_file = \$ENV{'GSDLCOLLECTDIR'} . \"/etc/acronym_definitions.pm\";\n";135 print ACRONYM_HANDLE "\$acronym_accumulate_file = $def_acronym_acc_file_pm\n"; 132 136 print ACRONYM_HANDLE "\n"; 133 137 print ACRONYM_HANDLE "# any acronym definitions which should always be marked up can be copied here\n"; … … 153 157 $allow_all_caps = $local_allow_all_caps; 154 158 @stop_words = @local_stop_words; 155 156 $local_acronym_accumulate_file = $local_acronym_accumulate_file; 157 158 159 &read_all_acronyms_from_file(); 159 160 161 &read_all_acronyms_from_file($acronym_accumulate_file); 160 162 # rename $acronym_file, $acronym_file . "." . int(rand (2<<7)). 161 163 # int(rand (2<<7)). int(rand (2<<7)). int(rand (2<<7)); … … 187 189 #eval a file of accumulated acronyms 188 190 sub read_all_acronyms_from_file { 189 191 my ($acronym_accumulate_file) = @_; 192 190 193 my $file_text = " "; 191 194 if (open ACRONYM_HANDLE, "<$acronym_accumulate_file")
Note:
See TracChangeset
for help on using the changeset viewer.