Changeset 20865 for gsdl/trunk/perllib/classify/List.pm
- Timestamp:
- 2009-10-30T10:55:28+13:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/perllib/classify/List.pm
r20825 r20865 47 47 [ { 'name' => "per_letter", 48 48 'desc' => "{List.level_partition.per_letter}" }, 49 { 'name' => "approximate_size", 50 'desc' => "{List.level_partition.approximate_size}"}, 49 51 { 'name' => "constant_size", 50 52 'desc' => "{List.level_partition.constant_size}" }, 51 { 'name' => "per_letter_fixed_size",52 'desc' => "{List.level_partition.per_letter_fixed_size}"},53 53 { 'name' => "none", 54 54 'desc' => "{List.level_partition.none}" } ]; … … 58 58 'constant_size' => 1, 59 59 'per_letter_fixed_size' => 1, 60 'approximate_size' => 1, 60 61 'none' => 1}; 61 62 … … 176 177 foreach my $metadata_group (@metadata_groups) { 177 178 my $partition_type_within_levelelem = shift(@partition_type_within_levellist); 179 if (defined($partition_type_within_levelelem) && $partition_type_within_levelelem eq "per_letter_fixed_size") { 180 print STDERR "per letter fixed size, changing to approximate size\n"; 181 $partition_type_within_levelelem = "approximate_size"; 182 } 178 183 if (defined($partition_type_within_levelelem) && defined $valid_partition_types->{$partition_type_within_levelelem}) { 179 184 $self->{$metadata_group . ".partition_type_within_level"} = $partition_type_within_levelelem; … … 376 381 } 377 382 383 # uppercase the metadata - makes the AZList nicer 384 $metadata_value = uc($metadata_value); 378 385 # Convert the metadata value from a UTF-8 string to a Unicode string 379 386 # This means that length() and substr() work properly … … 477 484 $classifier_node->{'childtype'} = "HList"; 478 485 } 479 elsif ($partition_type_within_level =~ /^ per_letter_fixed_size$/i) {486 elsif ($partition_type_within_level =~ /^approximate_size$/i) { 480 487 # Generate hlist based on the first letter of the metadata value (like per_letter) but with restriction on the partition size 481 488 # If a letter has fewer items than specified by the "partition_size_within_level", then group them together if possible … … 622 629 } 623 630 } 624 } 631 632 # The partitions are stored in an HList 633 $classifier_node->{'childtype'} = "HList"; 634 635 } # end approximate_size 625 636 else { 626 637 # Generate hlists of a certain size
Note:
See TracChangeset
for help on using the changeset viewer.