Changeset 33899

Show
Ignore:
Timestamp:
04.02.2020 13:03:05 (2 weeks ago)
Author:
kjdon
Message:

pass in new casefold and accentfold options (BaseClassifier?) to format_metadata_for_sorting

Files:
1 modified

Legend:

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

    r33490 r33899  
    229229    'desc' => "{List.metadata_sort.unicode} {List.sort_using_unicode_collation}", 
    230230    'type' => "flag" }, 
    231  
     231       
    232232      {'name' => "filter_metadata", 
    233233       'desc' => "{List.filter_metadata}", 
     
    525525    } 
    526526 
    527     $first_metadata_group_element_value  = &sorttools::format_metadata_for_sorting($first_metadata_group, $first_metadata_group_element_value, $doc_obj) unless $self->{'no_metadata_formatting'}; 
     527    $first_metadata_group_element_value  = &sorttools::format_metadata_for_sorting($first_metadata_group, $first_metadata_group_element_value, $doc_obj, $self->{'casefold_metadata_for_sorting'}, $self->{'accentfold_metadata_for_sorting'}) unless $self->{'no_metadata_formatting'}; 
    528528    if (defined($first_metadata_group_element_value) && $first_metadata_group_element_value ne "") { 
    529529        # This section must be included in the classifier as we have found a value 
     
    568568            # text-transform the stored lowercase values as capitalize or uppercase (can't CSS  
    569569            # text-transform if stored uppercase). 2 CSS text-transforms have been added to core.css 
    570             my $lc_metadata_value = lc($metadata_value); 
    571             $lc_metadata_value  = &sorttools::format_metadata_for_sorting($real_metadata_element, $lc_metadata_value, $doc_obj) unless $self->{'no_metadata_formatting'}; 
     570            ### no longer do this, as lowercasing is now an option for the user, and is handled by format_metadata_for_sorting 
     571            my $lc_metadata_value = $metadata_value; #lc($metadata_value); 
     572            $lc_metadata_value  = &sorttools::format_metadata_for_sorting($real_metadata_element, $lc_metadata_value, $doc_obj, $self->{'casefold_metadata_for_sorting'}, $self->{'accentfold_metadata_for_sorting'}) unless $self->{'no_metadata_formatting'}; 
    572573     
    573574            # Add the metadata value into the list for this combination of metadata group  
    574575            # and section - if we have some non-whitespace chars 
    575             # text that we have some non-whitespace chars 
     576            # test that we have some non-whitespace chars 
    576577            if ($lc_metadata_value =~ /\S/) { 
    577578             
     
    10901091    if (!$is_numeric || $numeric_partition_length == 1 ) { 
    10911092    return substr($mvalue, 0, 1); 
    1092     } 
     1093    }  
    10931094    if ($numeric_partition_length == -1) { 
    10941095    my ($all_digits) = $mvalue =~ /^([0-9]+)/;