login about faq

As of February 2015 Libcatcode is no longer accepting new questions. This site will stay up as the owner decides the next steps for preserving the content on the site. Thank you all for your support in the past three years!

Is there a standard way to normalize Library of Congress call numbers for sorting?

In the Voyager database, The holdings table has two call number fields in it, one that looks good for display like "B945.D44 S79 2011" and one that is normalized for sorting, like:

B  945            D 44   S 79   2011
I'd like to convert from the display format to something that will function similar to the normalized format; it need not be the same as Voyager's.

I am cobbling something together based on examples from Voyager, but want to make sure I don't forget any special cases.

asked Jan 25 '12 at 14:35

zemkat's gravatar image


There is this library (Python and Perl versions) that normalize standard LC call numbers into sortable strings. E.g E8 C11 D22 becomes E 000800C110D220.

See the wiki page for documentation.


answered Feb 06 '12 at 19:44

Ted's gravatar image


Since this answer has the most votes, shall we mark this as the offical answer?

(Mar 13 '12 at 21:12) yo_bj ♦♦

I spent a long, long time on this problem and have given up for the moment. The code referenced above is mine, as is a similar java approach at https://github.com/billdueber/lib.umich.edu-solr-stuff/blob/master/java/solrcontrib/umichnormalizers/src/main/java/edu/umich/lib/normalizers/LCCallNumberNormalizer.java

It's just really, really hard, and made harder by the fact that there isn't really a solid syntax for LC class numbers. I've had some success looking at using an actual parser- (as opposed to regex-) based approach but ran out of time to nail it down.

The Perl stuff is probably the most solid; Dan Wells took over maintenance of it last year. http://search.cpan.org/~dbwells/Library-CallNumber-LC-0.20/lib/Library/CallNumber/LC.pm

I'd start there.


answered Feb 13 '12 at 10:58

BillDueber's gravatar image


Unfortunately, I'm not sure how predictable the call number format is or isn't for your collection. Not all call numbers have two cutters. Some only have one. Some call numbers don't have dates. Then you also may have information after the date that is considered "part of" the call number (such as letters or volume numbers or phrases). There's also the call numbers that throw a year into the middle of the call number such as some history and law numbers. Or call numbers that are really just numbers in an index (such as SuDoc numbers for fiche) or a straight accession number. Do you know how your index table normalizes non-conforming call numbers like the cases above?

And then there are the things that have no call numbers...because a call number is really just an "address" to find the thing on the shelf.


answered Feb 06 '12 at 17:40

slmcdanold's gravatar image


What we have been using works rather well for all our LC call numbers, dewey, and local call numbers. I wrote this a number of years back, and if you can use Perl, look for cnparse.lib at http://homepages.wmich.edu/~zimmer/other_index.html Basically that does the normalizing leaving the sorting for you.

Another possibility (also in Perl) is here http://rocky.uta.edu/doran/sortlc/ It takes a slightly different approach; see what may work best for you.


answered Oct 27 '14 at 18:23

bookish's gravatar image


Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Jan 25 '12 at 14:35

Seen: 11,383 times

Last updated: Oct 27 '14 at 18:23

Powered by hamsters in the server | CSS skin by prtk