Changeset 20904

Show
Ignore:
Timestamp:
04.11.2009 15:22:05 (9 years ago)
Author:
kjdon
Message:

approximate size partition, don't do it if too few items

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/perllib/classify/List.pm

    r20865 r20904  
    459459    # Partition the values (if necessary) 
    460460    my $partition_type_within_level = $self->{$metadata_group . ".partition_type_within_level"}; 
     461    my $partition_size_within_level = $self->{$metadata_group . ".partition_size_within_level"}; 
    461462    if ($partition_type_within_level =~ /^per_letter$/i) { 
    462463    # Generate one hlist for each letter 
     
    484485    $classifier_node->{'childtype'} = "HList"; 
    485486    } 
    486     elsif ($partition_type_within_level =~ /^approximate_size$/i) { 
     487    elsif ($partition_type_within_level =~ /^approximate_size$/i && scalar(keys %metadata_value_to_OIDs_hash) > $partition_size_within_level) { 
    487488    # Generate hlist based on the first letter of the metadata value (like per_letter) but with restriction on the partition size 
    488489    # If a letter has fewer items than specified by the "partition_size_within_level", then group them together if possible 
     
    636637    else { 
    637638    # Generate hlists of a certain size 
    638     my $partition_size_within_level = $self->{$metadata_group . ".partition_size_within_level"}; 
    639639    if ($partition_type_within_level =~ /^constant_size$/i && scalar(keys %metadata_value_to_OIDs_hash) > $partition_size_within_level) { 
    640640        my @sortedmetadata_values = $self->sort_metadata_values_array(keys(%metadata_value_to_OIDs_hash));