Changeset 20828 for gsdl/trunk
- Timestamp:
- 2009-10-21T15:06:47+13:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/perllib/classify/DateList.pm
r20454 r20828 110 110 $self->{'metadata'} = $self->strip_ex_from_metadata($self->{'metadata'}); 111 111 $self->{'sort'} = $self->strip_ex_from_metadata($self->{'sort'}); 112 112 113 113 # now can have comma separated list of Dates - we just use the first one (for now) 114 114 my @meta_list = split(/,/, $self->{"metadata"}); … … 375 375 $currentlastdate = $subsection; 376 376 } else { 377 378 377 if ($currentfirstdate eq $currentlastdate) { 379 378 @{$compactedhash->{$currentfirstdate}} = @currentOIDs; … … 398 397 # add final OIDs to last sub-classification if there aren't many otherwise 399 398 # add final sub-classification 400 if ((scalar (@currentOIDs) < $min) && (scalar (@currentOIDs) > 0)) { 401 # want every thing in previous up to the dash 402 my ($newkey) = $lastkey =~ /^([^\-]+)/; 403 @currentOIDs = (@{$compactedhash->{$lastkey}}, @currentOIDs); 404 delete $compactedhash->{$lastkey}; 405 @{$compactedhash->{"$newkey-$currentlastdate"}} = @currentOIDs; 406 } else { 407 if ($currentfirstdate eq $currentlastdate) { 408 @{$compactedhash->{$currentfirstdate}} = @currentOIDs; 399 if (scalar (@currentOIDs) > 0) { 400 if ((scalar (@currentOIDs) < $min)) { 401 402 # want every thing in previous up to the dash 403 my ($newkey) = $lastkey =~ /^([^\-]+)/; 404 @currentOIDs = (@{$compactedhash->{$lastkey}}, @currentOIDs); 405 delete $compactedhash->{$lastkey}; 406 @{$compactedhash->{"$newkey-$currentlastdate"}} = @currentOIDs; 409 407 } else { 410 @{$compactedhash->{"$currentfirstdate-$currentlastdate"}} = @currentOIDs; 411 } 412 } 413 408 if ($currentfirstdate eq $currentlastdate) { 409 @{$compactedhash->{$currentfirstdate}} = @currentOIDs; 410 } else { 411 @{$compactedhash->{"$currentfirstdate-$currentlastdate"}} = @currentOIDs; 412 } 413 } 414 } 415 414 416 return $compactedhash; 415 417 }
Note:
See TracChangeset
for help on using the changeset viewer.