Changeset 33460


Ignore:
Timestamp:
2019-09-09T13:04:34+12:00 (5 years ago)
Author:
kjdon
Message:

fixed up some typos. removed use_hlist_for option. This is very hard to understand and actually only works if partition_type is none, and bookshelf_type is always - puts the bookshelves into hlist instead of vlist. instead, I have added all_values partition type. This just makes each value become a partition. Might be useful for Dates, or other short classification id.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/classify/List.pm

    r33454 r33460  
    8080    'desc' => "{List.level_partition.approximate_size}"},
    8181      { 'name' => "constant_size",
    82     'desc' => "{List.level_partition.constant_size}" },     
     82    'desc' => "{List.level_partition.constant_size}" }, 
     83      { 'name' => "all_values",
     84    'desc' => "{List.level_partition.all_values}" },
    8385      { 'name' => "none",
    8486    'desc' => "{List.level_partition.none}" } ];
     
    8991                  'constant_size' => 1,
    9092                  'approximate_size' => 1,
     93                  'all_values' => 1,
    9194                  'none' => 1};
    9295
     
    99102    'desc' => "{List.level_partition.per_number}" },
    100103      { 'name' => "single_partition",
    101     'desc' => "{List.level_partition_single}" },
     104    'desc' => "{List.level_partition.single}" },
    102105      { 'name' => "approximate_size",
    103106    'desc' => "{List.level_partition.approximate_size_numeric}"},
    104107      { 'name' => "constant_size",
    105108    'desc' => "{List.level_partition.constant_size}" },     
     109      { 'name' => "all_values",
     110    'desc' => "{List.level_partition.all_values}" },
    106111      { 'name' => "none",
    107112    'desc' => "{List.level_partition.none}" } ];
     
    114119                      'single_partition' => 1,
    115120                      'approximate_size' => 1,
     121                      'all_values' => 1,
    116122                                      'none' =>1  };
    117123
     
    202208     
    203209      { 'name' => "numbers_first",
    204     'desc' => "{List.numbers_first",
     210    'desc' => "{List.numbers_first}",
    205211    'type' => 'flag'},
    206212     
     
    223229    'desc' => "{List.metadata_sort.unicode} {List.sort_using_unicode_collation}",
    224230    'type' => "flag" },
    225      
    226       { 'name' => "use_hlist_for",
    227     'desc' => "{List.use_hlist_for}",
    228     'type' => "string" },
    229      
     231
    230232      {'name' => "filter_metadata",
    231233       'desc' => "{List.filter_metadata}",
     
    698700    # Otherwise just add all the values to a VList
    699701    else {
     702        if ($partition_type_within_level =~ /^all_values$/i) {
     703        $classifier_node->{'childtype'} = "HList";
     704        $self->{$metadata_group. ".bookshelf_type"} = "always";
     705        }
    700706        $self->add_vlist(\@metadata_groups, $classifier_node, \%metadata_value_to_OIDs_hash);
    701707    }
     
    743749    # Otherwise just add all the values to a VList
    744750    else {
     751    if ($numeric_partition_type_within_level =~ /^all_values$/i) {
     752        $classifier_node->{'childtype'} = "HList";
     753        $self->{$metadata_group. ".bookshelf_type"} = "always";
     754    }
     755   
    745756    $self->add_vlist(\@metadata_groups, $classifier_node, $numeric_metadata_value_to_OIDs_hash_ref);
    746757    }
Note: See TracChangeset for help on using the changeset viewer.