Lines 67-75
sub get_class_sort_key {
Link Here
|
67 |
$init =~ s/^([\p{IsAlpha}]+)/$1 /; |
67 |
$init =~ s/^([\p{IsAlpha}]+)/$1 /; |
68 |
my @tokens = split /\.|\s+/, $init; |
68 |
my @tokens = split /\.|\s+/, $init; |
69 |
my $digit_group_count = 0; |
69 |
my $digit_group_count = 0; |
|
|
70 |
my $first_digit_group_idx; |
70 |
for (my $i = 0; $i <= $#tokens; $i++) { |
71 |
for (my $i = 0; $i <= $#tokens; $i++) { |
71 |
if ($tokens[$i] =~ /^\d+$/) { |
72 |
if ($tokens[$i] =~ /^\d+$/) { |
72 |
$digit_group_count++; |
73 |
$digit_group_count++; |
|
|
74 |
if (1 == $digit_group_count) { |
75 |
$first_digit_group_idx = $i; |
76 |
} |
73 |
if (2 == $digit_group_count) { |
77 |
if (2 == $digit_group_count) { |
74 |
$tokens[$i] = sprintf("%-15.15s", $tokens[$i]); |
78 |
$tokens[$i] = sprintf("%-15.15s", $tokens[$i]); |
75 |
$tokens[$i] =~ tr/ /0/; |
79 |
$tokens[$i] =~ tr/ /0/; |
Lines 78-84
sub get_class_sort_key {
Link Here
|
78 |
} |
82 |
} |
79 |
# Pad the first digit_group if there was only one |
83 |
# Pad the first digit_group if there was only one |
80 |
if (1 == $digit_group_count) { |
84 |
if (1 == $digit_group_count) { |
81 |
$tokens[0] .= '_000000000000000' |
85 |
$tokens[$first_digit_group_idx] .= '_000000000000000' |
82 |
} |
86 |
} |
83 |
my $key = join("_", @tokens); |
87 |
my $key = join("_", @tokens); |
84 |
$key =~ s/[^\p{IsAlnum}_]//g; |
88 |
$key =~ s/[^\p{IsAlnum}_]//g; |
85 |
- |
|
|