Changeset 15703
- Timestamp:
- 2008-05-26T16:32:50+12:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/perllib/classify.pm
r15702 r15703 30 30 require util; 31 31 require AllList; 32 32 33 use gsprintf; 33 34 #use GDBM_File; 34 use strict; no strict 'subs'; 35 35 use unbuildutil; 36 36 … … 42 42 43 43 44 $oid_to_clids = {};44 my $oid_to_clids = {}; 45 45 46 46 sub load_classifier_for_info { … … 79 79 unshift (@INC, $colclassdir); 80 80 81 foreach $classifyoption (@$classify_list) {81 foreach my $classifyoption (@$classify_list) { 82 82 83 83 # get the classifier name … … 146 146 my ($classifiers) = @_; 147 147 148 foreach $classobj (@$classifiers) {148 foreach my $classobj (@$classifiers) { 149 149 $classobj->init(); 150 150 } … … 161 161 my $children = undef; 162 162 163 $childs = $doc_db_hash->{'contains'}; 164 if (defined ($childs)) { 165 $childs =~ s/\@$//; #remove trailing @ 166 $childs =~ s/^\"\.//; #remove initial ". 167 @$children = split /\;\"\./, $childs; 168 163 my $contains = $doc_db_hash->{'contains'}; 164 if (defined ($contains)) { 165 $contains =~ s/\@$//; #remove trailing @ 166 $contains =~ s/^\"\.//; #remove initial ". 167 @$children = split /\;\"\./, $contains; 169 168 } 170 169 … … 202 201 my ($doc_obj, $cursection, $doc_db_hash) = @_; 203 202 204 foreach $key (keys %$doc_db_hash) {203 foreach my $key (keys %$doc_db_hash) { 205 204 #don't need to store these metadata 206 205 next if $key =~ /(thistype|childtype|contains|docnum|doctype|classifytype)/i; … … 221 220 222 221 my @entries = split(/\n/, $gdb_str_ref); 223 foreach $entry (@entries) {222 foreach my $entry (@entries) { 224 223 my($key, $value) = ($entry =~ /^<([^>]*)>(.*?)$/ ); 225 224 $hashref->{$key} .= '@' if defined $hashref->{$key}; … … 288 287 my ($classifiers, $doc_obj) = @_; 289 288 290 foreach $classobj (@$classifiers) {289 foreach my $classobj (@$classifiers) { 291 290 my $title = $classobj->{'title'}; 292 291 $classobj->classify($doc_obj); … … 309 308 # get each of the classifications 310 309 my $next_classify_num = 1; 311 foreach $classifier (@$classifiers)310 foreach my $classifier (@$classifiers) 312 311 { 313 312 my $classifier_info = $classifier->get_classify_info($gli); … … 456 455 return $classifyinfo->{'numleafdocs'} if (defined $classifyinfo->{'numleafdocs'}); 457 456 458 foreach $content (@{$classifyinfo->{'contains'}}) {457 foreach my $content (@{$classifyinfo->{'contains'}}) { 459 458 if (defined $content->{'OID'}) { 460 459 # found a book
Note:
See TracChangeset
for help on using the changeset viewer.