[OPEN-ILS-DEV] LC Sort

Jason Etheridge jason at esilibrary.com
Sun Nov 23 20:58:24 EST 2008


On Sun, Nov 23, 2008 at 8:08 PM, Grant Johnson <fgjohnson at upei.ca> wrote:
> Are the results of a call number search sorted by LC in 1.4?
> Or does the shelf browser still need some work?

Hi Grant, as far I as know, outside of the reporting system call
numbers get sorted based on the individual alphanumeric characters
without any knowledge of their structure.

However, the main thing that is needed is for us to define a function
that can compare two call numbers and tell us which if any should come
before the other.  Such functions can be plugged into the generic sort
function in languages like Javascript and Perl very easily.  I'm sure
something similar can be done with Postgres for sorting within the
database, perhaps with stored procedures.

Any volunteers for coming up with such a base function?

I see some examples on the interwub:

http://www.mcgees.org/2001/08/08/sort-by-library-of-congress-call-number-in-perl/
http://tom.biodome.org/LOCsortPHP.html

And this is interesting:

http://search.cpan.org/~nkuitse/Biblio-LCC-0.09/script/lccnorm

And some reference pages:
http://library.dts.edu/Pages/RM/Helps/lc_call.shtml
http://geography.about.com/library/congress/blhowto.htm

So it looks like you have to break the call number up into 6 parts,
and potentially compare each part according to different rules (some
numerically, some alphanumerically, some numerically as if they were
right of a decimal, etc.)

I imagine an algorithm for dewey decimal would be simpler, if anyone
wants to volunteer for that too. :D

-- 
Jason Etheridge
 | VP, Community Support and Advocacy
 | Equinox Software, Inc. / The Evergreen Experts
 | phone:  1-877-OPEN-ILS (673-6457)
 | email:  jason at esilibrary.com
 | web:  http://www.esilibrary.com


More information about the Open-ils-dev mailing list