From 7e044751ef420933aeb36800dc8cf8c82e4fecd1 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Tue, 23 Oct 2007 14:07:20 -0500 Subject: [PATCH] ignore "/" when sorting Dewey call numbers Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- C4/ClassSortRoutine/Dewey.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/C4/ClassSortRoutine/Dewey.pm b/C4/ClassSortRoutine/Dewey.pm index a105d656a7..c077e835d0 100644 --- a/C4/ClassSortRoutine/Dewey.pm +++ b/C4/ClassSortRoutine/Dewey.pm @@ -45,7 +45,7 @@ Generates sorting key using the following rules: * Concatenates class and item part. * Converts to uppercase. -* Removes leading and trailing whitespace +* Removes leading and trailing whitespace and '/' * Separates alphabetic prefix from the rest of the call number * Splits into tokens on whitespaces and periods. * Leaves first digit group as is. @@ -61,6 +61,7 @@ sub get_class_sort_key { my $init = uc "$cn_class $cn_item"; $init =~ s/^\s+//; $init =~ s/\s+$//; + $init =~ s!/!!g; $init =~ s/^([\p{IsAlpha}]+)/$1 /; my @tokens = split /\.|\s+/, $init; my $digit_group_count = 0;